Skip to content

Commit

Permalink
fix: assume support before interviewing Basic CC
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Jul 9, 2024
1 parent e3ef70f commit 0ff111c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/cc/src/cc/BasicCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,20 @@ export class BasicCC extends CommandClass {
direction: "none",
});

// Assume that the endpoint supports Basic CC, so the values get persisted correctly.
endpoint.addCC(CommandClasses.Basic, { isSupported: true });

// try to query the current state
await this.refreshValues(applHost);

// Remove Basic CC support when there was no response
// Remove Basic CC support again when there was no response
if (
this.getValue(applHost, BasicCCValues.currentValue) == undefined
) {
applHost.controllerLog.logNode(node.id, {
endpoint: this.endpointIndex,
message:
"No response to Basic Get command, assuming the node does not support Basic CC...",
"No response to Basic Get command, assuming Basic CC is unsupported...",
});
// SDS14223: A controlling node MUST conclude that the Basic Command Class is not supported by a node (or
// endpoint) if no Basic Report is returned.
Expand Down

0 comments on commit 0ff111c

Please sign in to comment.