-
Notifications
You must be signed in to change notification settings - Fork 47
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 integration from UI & bugfix #350
Conversation
@gigatexel thanks for your help. But can you make one pull request for one feature. For example one only for the reload and one for removing entities and so on. I try to make branches from your pull request and cherry pick your commits. |
@gigatexel I think in the newest pyloxone this was already fixed: Entity None (<class 'custom_components.loxone.climate.LoxoneAcControl'>) implements HVACMode(s): off, auto and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/JoDehli/PyLoxone/issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gigatexel
Why do you make use of the property supported_features and not use the _attr_supported_features. This should result in the same behavior I think.
In my opinion the property is only useful when you want to change the supported feature dynamically.
@gigatexel why do we need this:
If something changes you can manually delete it from the entities and devices menu. I think it is not a good idea to delete it automatically without the user interaction. Sometimes a platform has an error an all devices a unavailable. And if you delete them automatically I do not know what happen with the history of this device. Maybe the user wants this entity or device and all the data which the system collected for this devices. An option could be to provide a service for both or one service which triggers both functions in a row. So the user can decide to call it once or even in a automation. |
@gigatexel maybe you can make another pull request with a service for both functions. |
@gigatexel for now I will not include the reloading as it is not stable at all. I tried it a few times to implement and could get to work reliable. What I learned from the last 12 years of maintaining this small integration is that if it is not working reliable do not implement it. You have much more trouble and work. |
A small update for the integration that should make using it a lot more convenient:
init.py
async_unload_entry
to enable reloading the integrationremove_unavailable_entities
andremove_unused_devices
to avoind orphaned devices/entities when function blocks are removed in Config.api.py
Add reconnect try/catch to avoid connecting to MS after the connection was closed
climate.py
Solve this warning:
I tested this on my system and works when removing/adding function blocks in Config and then reloading the integration instead of rebooting HA.
Maybe someone else can try and test?