Skip to content

Commit 821cc52

Browse files
committed
Set will throw on timeouts
1 parent c67a4dc commit 821cc52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,10 @@ class TuyaDevice extends EventEmitter {
456456
'error',
457457
'Timeout waiting for status response from device id: ' + this.device.id
458458
);
459-
// This case returns an undefined when set-for-get is used!
460-
// Alternative would be to throw but this would be breaking.
459+
if (!resolvedOrRejected) {
460+
resolvedOrRejected = true;
461+
throw new Error('Timeout waiting for status response from device id: ' + this.device.id);
462+
}
461463
}));
462464
}
463465

0 commit comments

Comments
 (0)