Skip to content

Commit 0d13f51

Browse files
authored
Merge pull request #136 from StrathCole/master
Json variable type fixed
2 parents fe1b20a + bd193e6 commit 0d13f51

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/tahoma.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,12 @@ Tahoma.prototype.updateDeviceState = function (event) {
12981298

12991299
if (object.type === "channel") {
13001300
try {
1301-
const subStates = JSON.parse(value);
1301+
let subStates;
1302+
if(typeof value === "object") {
1303+
subStates = value;
1304+
} else {
1305+
subStates = JSON.parse(value);
1306+
}
13021307
const channelPath = key;
13031308
for (const [attrName, attrValue] of Object.entries(subStates)) {
13041309
controller.ackStateValues[channelPath + "." + attrName] = attrValue;

0 commit comments

Comments
 (0)