hacs-hafas
hacs-hafas copied to clipboard
Harmonize unknown or unavailable sensor states
Interesting observation: my sensor was "unknown" while the other one was "unavailable". I restarted home assistant and mine became unavailable, too. Something to harmonize in a future update...
See #30
I would say, the sensor should be unknown, when no connections are found. It should be unavailable when an error occurs.
See for setup errors: https://developers.home-assistant.io/docs/integration_setup_failures#integrations-using-async_setup_entry
And we can set self._attr_available = True. See here: https://developers.home-assistant.io/docs/core/entity#example