Skip to content

Commit

Permalink
πŸ› Correct inclusion check
Browse files Browse the repository at this point in the history
Two bugs:
- range is exclusive on the upper bound
- range is a set of discrete values
  • Loading branch information
kamaradclimber committed Sep 8, 2024
1 parent d0ab468 commit ce785f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/aquarea/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def target_temperature_message_received(message):
f"{self._climate_type()} Received target temperature for {self.zone_id}: {self._attr_target_temperature}"
)
if self._attr_min_temp != None and self._attr_max_temp != None:
if self._attr_target_temperature not in range(self._attr_min_temp, self._attr_max_temp):
if self._attr_target_temperature < self._attr_min_temp or self._attr_target_temperature > self._attr_max_temp:
# when reaching that point, maybe we should set a wider range to avoid blocking user?
_LOGGER.warn(f"{self._climate_type()} Target temperature is not within expected range, this is suspicious. {self._attr_target_temperature} should be within [{self._attr_min_temp},{self._attr_max_temp}]")
self.async_write_ha_state()
Expand Down

0 comments on commit ce785f3

Please sign in to comment.