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

fix: Optimize state updates and ensure ON_OFF feature support for HVACMode.OFF #86

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

sayam93
Copy link
Contributor

@sayam93 sayam93 commented Dec 24, 2024

Code optimizations to prevent redundant state updates by updating entity attributes only when actual changes occur, reducing unnecessary state writes. It separates internal updates of entity attributes from those directly changed by users or automations. Previously, it was possible that the climate entities would not restore state properly on Home Assistant restarts

This further resolves a warning related in Home Assistant related to entities that implement HVACMode.OFF but do not explicitly declare the ClimateEntityFeature.ON_OFF feature. To ensure compatibility across Home Assistant versions, it dynamically adds the ON_OFF feature only if HVACMode.OFF exists for the templated entity.

Fixes #61 #76 and #79

Code formatted by black.

…CMode.OFF

Code optimizations to prevent redundant state updates by updating entity attributes only when actual changes occur, reducing unnecessary state writes. It separates internal updates of entity attributes from those directly changed by users or automations. Previously, it was possible that the climate entities would not restore state properly on Home Assistant restarts

This further resolves a warning related in Home Assistant related to entities that implement HVACMode.OFF but do not explicitly declare the ClimateEntityFeature.ON_OFF feature. To ensure compatibility across Home Assistant versions, it dynamically adds the ON_OFF feature only if HVACMode.OFF exists for the templated entity.

Fixes #61 #76 and #79

Code formatted by black.
@sayam93
Copy link
Contributor Author

sayam93 commented Dec 24, 2024

@jcwillox Kindly take a look. Please do let me know if there's any further issues.

@jcwillox jcwillox requested a review from Copilot December 28, 2024 03:30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@sayam93
Copy link
Contributor Author

sayam93 commented Dec 29, 2024

@jcwillox Thanks for approving the changes. Eagerly waiting for a new version of the integration with this code merged into it.

@sayam93
Copy link
Contributor Author

sayam93 commented Jan 6, 2025

@jcwillox Thanks for merging this code. However, I could not update in my HA as it probably wasn't added to a release.

Copy link

github-actions bot commented Jan 8, 2025

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jcwillox
Copy link
Owner

jcwillox commented Jan 8, 2025

@jcwillox Thanks for merging this code. However, I could not update in my HA as it probably wasn't added to a release.

Yep, I wanted to cut a 1.0 release for the breaking change, but I had an issue with turn off not working, so had to fix that but then had to fix my other integration which broke with the 2025.1 release, so this got pushed back.

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