pschroeder89 / homebridge-levoit-humidifiers

Levoit Humidifiers Plugin for Apple HomeKit via Homebridge
Apache License 2.0
70 stars 9 forks source link

Trailing blank in user e-mail causes homebridge crash #62

Closed nyjklein closed 6 months ago

nyjklein commented 6 months ago

Describe The Bug: Trailing blank in user e-mail causes homebridge crash and continuous restart cycle

To Reproduce: Insert a Trailing blank in user e-mail via either the GUI or the json.

Expected behavior: No crash

Logs:

[02/01/2024, 12:05:07] [Levoit Humidifiers] Discovering devices...
[02/01/2024, 12:05:07] Error: The user is not logged in!
    at /var/lib/homebridge/node_modules/homebridge-levoit-humidifiers/src/api/VeSync.ts:278:15
    at /var/lib/homebridge/node_modules/homebridge-levoit-humidifiers/node_modules/async-lock/lib/index.js:171:12
    at AsyncLock._promiseTry (/var/lib/homebridge/node_modules/homebridge-levoit-humidifiers/node_modules/async-lock/lib/index.js:306:31)
    at exec (/var/lib/homebridge/node_modules/homebridge-levoit-humidifiers/node_modules/async-lock/lib/index.js:170:9)
    at AsyncLock.acquire (/var/lib/homebridge/node_modules/homebridge-levoit-humidifiers/node_modules/async-lock/lib/index.js:189:3)
    at VeSync.getDevices (/var/lib/homebridge/node_modules/homebridge-levoit-humidifiers/src/api/VeSync.ts:276:17)
    at Platform.discoverDevices (/var/lib/homebridge/node_modules/homebridge-levoit-humidifiers/src/platform.ts:80:39)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Plugin Config:

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

Screenshots:

Environment:

pschroeder89 commented 6 months ago

Not sure I understand the use case here. Why are you entering the email with a trailing space?

nyjklein commented 6 months ago

It was an accident. I used an autofill from my keyboard which added the trailing blank. Not really a use case. But it really shouldn't send HB into a crash/restart loop!

pschroeder89 commented 6 months ago

Fixed in 1.12.0

image