Skip to content

Commit

Permalink
Set will throw on timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Jan 6, 2025
1 parent c67a4dc commit 821cc52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,10 @@ class TuyaDevice extends EventEmitter {
'error',
'Timeout waiting for status response from device id: ' + this.device.id
);
// This case returns an undefined when set-for-get is used!
// Alternative would be to throw but this would be breaking.
if (!resolvedOrRejected) {
resolvedOrRejected = true;
throw new Error('Timeout waiting for status response from device id: ' + this.device.id);
}
}));
}

Expand Down

0 comments on commit 821cc52

Please sign in to comment.