seydx / homebridge-philipsair-platform

Homebridge plugin for philips air purifier and humidifier.
MIT License
24 stars 14 forks source link

Unexpected token { in JSON #132

Open cbracegirdle opened 1 year ago

cbracegirdle commented 1 year ago

Describe the bug The plugin keeps crashing and causing my homebridge to restart

To Reproduce Install and set up with Philips Air Purifier

Expected behavior No crashing - if error in JSON, handle this gracefully.

Logs

[06/11/2022, 18:12:04] SyntaxError: Unexpected token { in JSON at position 632
    at JSON.parse (<anonymous>)
    at Socket.<anonymous> (/usr/local/lib/node_modules/homebridge-philipsair-platform/src/accessories/accessories.handler.js:352:23)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

Environment

jchristianj commented 1 year ago

Same issue here: [2/25/2023, 3:22:58 PM] SyntaxError: Unexpected token { in JSON at position 738 at JSON.parse () at Socket. (/var/lib/homebridge/node_modules/homebridge-philipsair-platform/src/accessories/accessories.handler.js:352:23) at Socket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Socket.Readable.push (node:internal/streams/readable:234:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) [2/25/2023, 3:22:58 PM] Got SIGTERM, shutting down Homebridge...

crashing complete homebridge. Is there any solution in sight?

Thanks, regards, Christian