diff --git a/packages/cc/src/cc/Security2CC.ts b/packages/cc/src/cc/Security2CC.ts index 1a7f1426d655..f66f6806e84c 100644 --- a/packages/cc/src/cc/Security2CC.ts +++ b/packages/cc/src/cc/Security2CC.ts @@ -1813,7 +1813,7 @@ export class Security2CCMessageEncapsulation extends Security2CC { && prevSequenceNumber != undefined && this["_sequenceNumber"] === ((prevSequenceNumber + 1) & 0xff) // And in case of a mock-based test, do this only on the controller - && !this.host.__internalIsMockNode + && !ctx.__internalIsMockNode ) { const nonce = spanState.currentSPAN.nonce; spanState.currentSPAN = undefined; diff --git a/packages/host/src/ZWaveHost.ts b/packages/host/src/ZWaveHost.ts index c2bbf99d9f41..a525c9b7c596 100644 --- a/packages/host/src/ZWaveHost.ts +++ b/packages/host/src/ZWaveHost.ts @@ -44,6 +44,7 @@ export interface CCParsingContext extends Readonly, GetDeviceConfig, HostIDs { sourceNodeId: number; + __internalIsMockNode?: boolean; /** If known, the frame type of the containing message */ frameType?: FrameType; @@ -112,8 +113,6 @@ export interface ZWaveHost { nodeId: number, endpointIndex?: number, ): boolean; - - __internalIsMockNode?: boolean; } /** Host application abstractions that provide support for reading and writing values to a database */ diff --git a/packages/host/src/mocks.ts b/packages/host/src/mocks.ts index 765c493a8a65..368c8a877c51 100644 --- a/packages/host/src/mocks.ts +++ b/packages/host/src/mocks.ts @@ -30,10 +30,7 @@ export type BaseTestNode = export type TestingHost< TNode extends BaseTestNode, > = - & Omit< - ZWaveApplicationHost, - "__internalIsMockNode" - > + & ZWaveApplicationHost & { setNode(nodeId: number, node: TNode): void; }; diff --git a/packages/testing/src/MockNode.ts b/packages/testing/src/MockNode.ts index d7bc77c83284..57d2d4cf0263 100644 --- a/packages/testing/src/MockNode.ts +++ b/packages/testing/src/MockNode.ts @@ -115,7 +115,6 @@ export class MockNode { // A node's host is a bit more specialized than the controller's host. this.host = { ...this.controller.host, - __internalIsMockNode: true, // // Mimic the behavior of ZWaveNode, but for arbitrary node IDs }; diff --git a/packages/zwave-js/src/lib/controller/MockControllerBehaviors.ts b/packages/zwave-js/src/lib/controller/MockControllerBehaviors.ts index ecd8219717be..5fea5577cd17 100644 --- a/packages/zwave-js/src/lib/controller/MockControllerBehaviors.ts +++ b/packages/zwave-js/src/lib/controller/MockControllerBehaviors.ts @@ -99,6 +99,7 @@ function createLazySendDataPayload( origin: MessageOrigin.Host, context: { sourceNodeId: node.id, + __internalIsMockNode: true, ...node.encodingContext, ...node.securityManagers, },