Skip to content

Commit

Permalink
Bugfix for malformed json from airpurifier m1
Browse files Browse the repository at this point in the history
  • Loading branch information
Krim authored and Krim committed Dec 8, 2018
1 parent dbd66fd commit b82fa53
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 @@ -8,6 +8,8 @@ module.exports = function(str) {
str = str.replace('[,]', '[null,null]');
// for aqara body sensor (lumi.motion.aq2)
str = str.replace('[,,]', '[null,null,null]');
// for Xiaomi Air Purifier m1 without internet access
str = str.replace(',,', ',');

return JSON.parse(str);
}
Expand Down

0 comments on commit b82fa53

Please sign in to comment.