Skip to content

Commit

Permalink
Merge pull request aholstenson#125 from thunderace/master
Browse files Browse the repository at this point in the history
fix JSON for aqara body sensor
  • Loading branch information
aholstenson authored Mar 8, 2018
2 parents 9a9474e + f3f8356 commit 3fc0e0b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/safeishJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module.exports = function(str) {
} catch(ex) {
// Case 1: Load for subdevices fail as they return empty values
str = str.replace('[,]', '[null,null]');
// for aqara body sensor (lumi.motion.aq2)
str = str.replace('[,,]', '[null,null,null]');

return JSON.parse(str);
}
Expand Down

0 comments on commit 3fc0e0b

Please sign in to comment.