From 8b29a835024b341f770b9e8128b824889c85cae2 Mon Sep 17 00:00:00 2001 From: Dominic Griesel Date: Thu, 24 Oct 2024 08:58:48 +0200 Subject: [PATCH] fix: update example mock-server config --- server_config.js | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/server_config.js b/server_config.js index 6f5b3fec5db8..eabf48f1cd14 100644 --- a/server_config.js +++ b/server_config.js @@ -49,28 +49,21 @@ module.exports.default = { }, behaviors: [ { - async onControllerFrame(controller, self, frame) { + async handleCC(controller, self, receivedCC) { if ( - frame.type === MockZWaveFrameType.Request - && frame.payload instanceof SupervisionCCGet - && frame.payload.encapsulated + receivedCC instanceof SupervisionCCGet + && receivedCC.encapsulated instanceof ConfigurationCCSet ) { - const cc = new SupervisionCCReport(self.host, { - nodeId: controller.host.ownNodeId, - sessionId: frame.payload.sessionId, + const cc = new SupervisionCCReport({ + nodeId: controller.ownNodeId, + sessionId: receivedCC.sessionId, moreUpdatesFollow: false, status: SupervisionStatus.Fail, }); - // await wait(500); - await self.sendToController( - createMockZWaveRequestFrame(cc, { - ackRequested: false, - }), - ); - return true; + + return { action: "sendCC", cc }; } - return false; }, }, ],