JeroenvO / homeassistant-cz20-badge

Connect cz2020 badge from badge.team to home-assistant as binary sensor
MIT License
1 stars 0 forks source link

Connection lost after restart home assistant #2

Closed arno58 closed 3 years ago

arno58 commented 3 years ago

After i restart home assistant the cz2020 badge does not restore the connection

JeroenvO commented 3 years ago

Indeed a problem. I assumed the app would close on failing connections (https://github.com/JeroenvO/homeassistant-cz20-badge/blob/main/__init__.py#L53) but it doesn't.

Restarting home-assistant doesn't happen often and restarting the app is easy, so not a too big deal.

Possible fixes maybe in a umqtt disconnect event bind (but i can't find if this exists) or to listen to some message from homeassistant on restart/stop to trigger the app to close/restart as well.