Skip to content

Commit

Permalink
fix JSON for aqara body sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
thunder committed Mar 8, 2018
1 parent 9a9474e commit f3f8356
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 f3f8356

Please sign in to comment.