Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload knxsync when knx reloads #3

Open
envy opened this issue Mar 27, 2023 · 1 comment
Open

Reload knxsync when knx reloads #3

envy opened this issue Mar 27, 2023 · 1 comment

Comments

@envy
Copy link
Owner

envy commented Mar 27, 2023

There is no direct way to find out when an integration reloads. But we can register ourselves on service_registered and service_removed to figure out if the knx services still exist.

https://www.home-assistant.io/docs/configuration/events/

idea: when service is removed, switch into failed state, restart automatically and on start check if services are there and if not, go into failed state again

@farmio
Copy link

farmio commented Jul 6, 2023

Have a look at https://github.com/home-assistant/core/blob/cb7fa494a432dbcf004b5ffd6e3027cef3c9ed11/homeassistant/components/knx/__init__.py#L319
This seems to be the standard way when reloading via DevTools/YAML. I'm not sure if it is the same for the config entry reload.

service_removed for knx.send should work in all cases.

Or you observe one of the Interface entity states. They should turn "unavailable" when disconnected (which should, but may not only happen on reload).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants