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 integration from UI & bugfix #350

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

gigatexel
Copy link
Contributor

A small update for the integration that should make using it a lot more convenient:

init.py

  • Implement async_unload_entry to enable reloading the integration
  • Add remove_unavailable_entities and remove_unused_devices to avoind orphaned devices/entities when function blocks are removed in Config.
  • Removed loading the SCENE platform and let it load as a standard platform from const.py

api.py

Add reconnect try/catch to avoid connecting to MS after the connection was closed

climate.py

Solve this warning:

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

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?

@JoDehli
Copy link
Owner

JoDehli commented Dec 8, 2024

@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.

@JoDehli
Copy link
Owner

JoDehli commented Dec 8, 2024

@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

Copy link
Owner

@JoDehli JoDehli Dec 8, 2024

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.

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

Successfully merging this pull request may close these issues.

2 participants