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

Trigger controller override calculation when zone current temperature changes #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions custom_components/zoned_heating/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ async def async_zone_state_changed(self, entity, old_state, new_state):
# setpoint of a zone was updated, check whether controller needs to be updated
_LOGGER.debug("Zone {} updated: setpoint={}".format(entity, new_state[ATTR_TEMPERATURE]))
await self.async_calculate_override()

if (
old_state[ATTR_CURRENT_TEMPERATURE] != new_state[ATTR_CURRENT_TEMPERATURE] and
isinstance(new_state[ATTR_CURRENT_TEMPERATURE], float)
):
# current temperature of a zone was updated, check whether controller needs to be updated
_LOGGER.debug("Zone {} updated: current temperature={}".format(entity, new_state[ATTR_CURRENT_TEMPERATURE]))
await self.async_calculate_override()

if old_state[ATTR_HVAC_ACTION] != new_state[ATTR_HVAC_ACTION]:
# action of a zone was updated, check whether controller needs to be updated
Expand Down