Skip to content

Commit e248e10

Browse files
authored
Fixes "TypeError: Cannot set property '3' of undefined"
`dps` does not exist yet so we cannot set a property of undefined. ('3' is the brightness for Tuya light bulbs)
1 parent 1bf8450 commit e248e10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ TuyaDevice.prototype.set = function (options) {
230230
if (options.dps === undefined) {
231231
thisRequest.dps = {1: options.set};
232232
} else {
233-
thisRequest.dps[options.dps.toString()] = options.set;
233+
thisRequest.dps = {[options.dps.toString()]: options.set};
234234
}
235235

236236
debug('Payload: ');

0 commit comments

Comments
 (0)