Skip to content

Commit

Permalink
Revert "test: debug output for sendNodeToSleep"
Browse files Browse the repository at this point in the history
This reverts commit a3c3b18.
  • Loading branch information
AlCalzone committed Jun 10, 2020
1 parent ed25dde commit 9f2231f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
17 changes: 1 addition & 16 deletions src/lib/driver/Driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2513,30 +2513,15 @@ ${handlers.length} left`,

// Sends a node to sleep if it has no more messages.
const sendNodeToSleep = (node: ZWaveNode): void => {
log.controller.logNode(
node.id,
`debounceSendNodeToSleep > sendNodeToSleep
has pending msgs: ${this.hasPendingMessages(node)}`,
);
this.sendNodeToSleepTimers.delete(node.id);
if (!this.hasPendingMessages(node)) {
void node.sendNoMoreInformation().catch((e) => {
log.controller.logNode(
node.id,
`debounceSendNodeToSleep > error in sendNoMoreInformation: ${e}`,
);
void node.sendNoMoreInformation().catch(() => {
/* ignore errors */
});
}
};

// If a sleeping node has no messages pending, we may send it back to sleep
log.controller.logNode(
node.id,
`debounceSendNodeToSleep
supports wake up: ${node.supportsCC(CommandClasses["Wake Up"])}
has pending msgs: ${this.hasPendingMessages(node)}`,
);
if (
node.supportsCC(CommandClasses["Wake Up"]) &&
!this.hasPendingMessages(node)
Expand Down
12 changes: 0 additions & 12 deletions src/lib/node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2630,18 +2630,6 @@ version: ${this.version}`;
* Sends the node a WakeUpCCNoMoreInformation so it can go back to sleep
*/
public async sendNoMoreInformation(): Promise<boolean> {
log.controller.logNode(
this.id,
`sendNoMoreInformation
keepAwake: ${this.keepAwake}
is awake: ${this.isAwake()}
interview stage: ${getEnumMemberName(
InterviewStage,
this.interviewStage,
)}
isSendingNoMoreInformation: ${this.isSendingNoMoreInformation}
`,
);
// Don't send the node back to sleep if it should be kept awake
if (this.keepAwake) return false;

Expand Down

0 comments on commit 9f2231f

Please sign in to comment.