-
-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
217 additions
and
177 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import type { | ||
CommandClassInfo, | ||
CommandClasses, | ||
} from "../capabilities/CommandClasses"; | ||
import type { | ||
MulticastDestination, | ||
NODE_ID_BROADCAST, | ||
NODE_ID_BROADCAST_LR, | ||
} from "../consts"; | ||
|
||
/** A basic abstraction of a Z-Wave Command Class providing access to the relevant functionality */ | ||
export interface CCId { | ||
nodeId: number | MulticastDestination; | ||
endpointIndex?: number; | ||
ccId: CommandClasses; | ||
ccCommand?: number; | ||
} | ||
|
||
export type SinglecastCC<T extends CCId = CCId> = T & { | ||
nodeId: number; | ||
}; | ||
|
||
export type MulticastCC<T extends CCId = CCId> = T & { | ||
nodeId: MulticastDestination; | ||
}; | ||
|
||
export type BroadcastCC<T extends CCId = CCId> = T & { | ||
nodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR; | ||
}; | ||
|
||
/** Allows querying if a CC is supported and in which version */ | ||
export interface SupportsCC { | ||
supportsCC(cc: CommandClasses): boolean; | ||
getCCVersion(cc: CommandClasses): number; | ||
} | ||
|
||
/** Allows querying if a CC is controlled */ | ||
export interface ControlsCC { | ||
controlsCC(cc: CommandClasses): boolean; | ||
} | ||
|
||
/** Allows querying if a CC is supported or controlled only securely */ | ||
export interface IsCCSecure { | ||
isCCSecure(cc: CommandClasses): boolean; | ||
} | ||
|
||
/** Allows querying all implemented CCs and their information */ | ||
export interface GetCCs { | ||
getCCs(): Iterable<[ccId: CommandClasses, info: CommandClassInfo]>; | ||
} | ||
|
||
/** Allows modifying the list of supported/controlled CCs */ | ||
export interface ModifyCCs { | ||
addCC(cc: CommandClasses, info: Partial<CommandClassInfo>): void; | ||
removeCC(cc: CommandClasses): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { type MulticastDestination } from "../consts/Transmission"; | ||
import { type NodeId } from "./Nodes"; | ||
|
||
/** Identifies an endpoint */ | ||
export interface EndpointId { | ||
readonly virtual: false; | ||
readonly nodeId: number; | ||
readonly index: number; | ||
} | ||
|
||
/** Identifies a virtual endpoint */ | ||
export interface VirtualEndpointId { | ||
readonly virtual: true; | ||
readonly nodeId: number | MulticastDestination; | ||
readonly index: number; | ||
} | ||
|
||
/** Allows accessing the parent node of the endpoint, if it exists */ | ||
export interface GetEndpointNode<T extends NodeId> { | ||
tryGetNode(): T | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { type SecurityManager } from "../security/Manager"; | ||
import { type SecurityManager2 } from "../security/Manager2"; | ||
|
||
/** Allows accessing the security manager instances */ | ||
export interface SecurityManagers { | ||
/** Management of Security S0 keys and nonces */ | ||
securityManager: SecurityManager | undefined; | ||
/** Management of Security S2 keys and nonces (Z-Wave Classic) */ | ||
securityManager2: SecurityManager2 | undefined; | ||
/** Management of Security S2 keys and nonces (Z-Wave Long Range) */ | ||
securityManagerLR: SecurityManager2 | undefined; | ||
} |
Oops, something went wrong.