Hernas / homebridge-salus-sq610

Apache License 2.0
8 stars 4 forks source link

Bad json response #8

Open ipsumium opened 3 days ago

ipsumium commented 3 days ago

Describe The Bug:

Entered the IP and euid of my device and i've got the attached error To Reproduce:

Expected behavior:

Logs:

[11/19/2024, 12:30:35 AM] [SalusSQ610HomebridgePlugin] Could not load the devices: SyntaxError: Unexpected token 'G', "G1" is not valid JSON
[11/19/2024, 12:30:35 AM] [SalusSQ610HomebridgePlugin] Could not load the devices: SyntaxError: Unexpected token 'G', "G1" is not valid JSON
    at JSON.parse (<anonymous>)
    at /homebridge/node_modules/@hernas/homebridge-salus-sq610/src/SalusConnect.ts:198:35
    at Array.forEach (<anonymous>)
    at SalusConnect.getDevices (/homebridge/node_modules/@hernas/homebridge-salus-sq610/src/SalusConnect.ts:190:18)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at SalusSQ610HomebridgePlatform.discoverDevices (/homebridge/node_modules/@hernas/homebridge-salus-sq610/src/platform.ts:60:17)

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

california444 commented 2 days ago

Hello @ipsumium , thanks for reporting. Seems like deviceName must not always be a JSON object. I created a PR to better handle this situation: https://github.com/Hernas/homebridge-salus-sq610/pull/9