bostrt / homebridge-bali-blinds

Bali Motorized Blinds Plugin for Homebridge
Apache License 2.0
4 stars 1 forks source link

Validate config before launch #12

Closed bostrt closed 9 months ago

bostrt commented 9 months ago

The plugin tries to just run even if invalid config values provided. For example, when neither username or password are provided:

[28/11/2023, 16:27:46] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-bali-blinds) is running on port 47746.
Error: Failed to login to MIOS Portal due to error Error: Request failed. 400, body: ERROR:Invalid parameters:
    at /var/lib/homebridge/node_modules/homebridge-bali-blinds/src/auth.ts:39:18
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Or, when only a username is provided:

Error: Failed to login to MIOS Portal due to error Error: Request failed. 404, body: ERROR:No data
    at /var/lib/homebridge/node_modules/homebridge-bali-blinds/src/auth.ts:39:18
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Probably related: https://www.reddit.com/r/homebridge/comments/olgsql/comment/kb6pcmf/?context=3

bostrt commented 9 months ago

https://github.com/bostrt/homebridge-bali-blinds/releases/tag/v0.0.5-beta.3