nt0xa / homebridge-mi-humidifier

A Xiaomi Mi humidifier plugin for Homebridge
MIT License
64 stars 24 forks source link

Graceful error handling for inactive / unplugged devices #56

Closed bubffm closed 3 years ago

bubffm commented 3 years ago

As the humidifier is a "seasonal" product which I will put in the cellar at the end of the heating season (Late February / Mid March over here), I wonder whether it might be possible to give a "smart" message that the device is not plugged in rather than a full throttled error that can take the homebridge down.

Alternative would be, that I'd have to take the entries for my humidifiers out of config, save them somewhere else, and put them back in again for the next heating season, which isnt very comfortable.

Is this something that might be possible to consider, maybe by adding a config item "smart error": true/false - or similar?

Many thanks

nt0xa commented 3 years ago

Hey @bubffm, The error handling changed in the latest version, so they should look nicer now. Maybe it will be better to add flag "enabled" (true/false) to device config to temporary disable it? By default it will be equal to true.

bubffm commented 3 years ago

. Maybe it will be better to add flag "enabled" (true/false) to device config to temporary disable it?

That sounds like a good way of handling it.

nt0xa commented 3 years ago

Hey @bubffm, I've added new option "disabled": true/false (false by default) to device config in the latest version. This should fix the issue.

bubffm commented 3 years ago

hey @russtone,

thanks thats great. Could you just add that to the sample config for documentation purposes. Many thanks

nt0xa commented 3 years ago

Added description to README.md