Skip to content

Commit

Permalink
refactor: nuke ZWaveApplicationHost into orbit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Oct 17, 2024
1 parent bd5aeea commit 4627146
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
19 changes: 0 additions & 19 deletions packages/host/src/ZWaveHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,25 +161,6 @@ export interface GetCommunicationTimeouts {

export type LogNode = Pick<ControllerLogger, "logNode">;

export interface ZWaveApplicationHost<TNode extends NodeId = NodeId>
extends
GetValueDB,
HostIDs,
GetNode<TNode>,
GetAllNodes<TNode>,
SecurityManagers,
GetDeviceConfig,
LookupManufacturer,
SchedulePoll,
GetSupportedCCVersion,
GetSafeCCVersion,
SendCommand,
GetInterviewOptions,
GetUserPreferences,
GetCommunicationTimeouts,
LogNode
{}

/** Allows scheduling a value refresh (poll) for a later time */
export interface SchedulePoll {
schedulePoll(
Expand Down
20 changes: 10 additions & 10 deletions packages/host/src/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ export type BaseTestNode =
& IsCCSecure
& GetEndpoint<BaseTestEndpoint>;

export interface TestingHost extends
HostIDs,
GetValueDB,
// GetSafeCCVersion,
GetSupportedCCVersion,
GetAllNodes<BaseTestNode>,
GetNode<BaseTestNode>,
GetDeviceConfig,
LogNode
export interface TestingHost
extends
HostIDs,
GetValueDB,
GetSupportedCCVersion,
GetAllNodes<BaseTestNode>,
GetNode<BaseTestNode>,
GetDeviceConfig,
LogNode
{
setNode(nodeId: number, node: BaseTestNode): void;
}

/** Creates a {@link ZWaveApplicationHost} that can be used for testing */
/** Creates a {@link TestingHost} that can be used instead of a real driver instance in tests */
export function createTestingHost(
options: Partial<CreateTestingHostOptions> = {},
): TestingHost {
Expand Down

0 comments on commit 4627146

Please sign in to comment.