From 5133765952e18bfbe46de250b5cbf0bb6b96bfdd Mon Sep 17 00:00:00 2001 From: magnuselden Date: Thu, 14 Dec 2023 17:58:03 +0100 Subject: [PATCH] misc fixes --- .../service/hvac/house_heater/house_heater_coordinator.py | 2 +- .../service/hvac/water_heater/water_heater_next_start.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/peaqhvac/service/hvac/house_heater/house_heater_coordinator.py b/custom_components/peaqhvac/service/hvac/house_heater/house_heater_coordinator.py index fc455d8b..2d79248f 100644 --- a/custom_components/peaqhvac/service/hvac/house_heater/house_heater_coordinator.py +++ b/custom_components/peaqhvac/service/hvac/house_heater/house_heater_coordinator.py @@ -63,7 +63,7 @@ def current_offset(self, val) -> None: @property def current_tempdiff(self): - return get_tempdiff_inverted(self.current_offset, self._hvac.hub.sensors.get_tempdiff()) + return get_tempdiff_inverted(self.current_offset, self._hvac.hub.sensors.get_tempdiff(), self._current_tolerances) def get_current_offset(self) -> Tuple[int, bool]: self._offsets = self._hvac.model.current_offset_dict_combined diff --git a/custom_components/peaqhvac/service/hvac/water_heater/water_heater_next_start.py b/custom_components/peaqhvac/service/hvac/water_heater/water_heater_next_start.py index 13a5832c..c26bf558 100644 --- a/custom_components/peaqhvac/service/hvac/water_heater/water_heater_next_start.py +++ b/custom_components/peaqhvac/service/hvac/water_heater/water_heater_next_start.py @@ -196,8 +196,7 @@ def _calculate_next_start(self, delay_dt=None, current_dm=None) -> tuple[datetim if len(self.model.demand_hours): required_delay = self.model.latest_boost + timedelta(hours=REQUIRED_DEMAND_DELAY) - loopstart = max(self.model.now_dt, - min(self.norm_dt(self.model.cold_limit), self.norm_dt(required_delay))) + loopstart = max(self.norm_dt(self.model.now_dt),min(self.norm_dt(self.model.cold_limit), self.norm_dt(required_delay))) use_floating_mean = False min_demand_hour = min( (hour for hour in self.model.demand_hours if hour > max(loopstart, self.model.cold_limit)),