Skip to content

Commit

Permalink
fix: update example mock-server config
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Oct 24, 2024
1 parent c90f592 commit 8b29a83
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions server_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
},
],
Expand Down

0 comments on commit 8b29a83

Please sign in to comment.