Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuselden authored and magnuselden committed Oct 27, 2024
1 parent bf6c3d9 commit 68ebb24
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,21 @@ def _keep_compressor_running(self, offsetdata: CalculatedOffsetModel, force_upda
def temporarily_lower_offset(self, offsetdata: CalculatedOffsetModel) -> bool:
if self._wait_timer_breach.is_timeout():
if any([self._lower_offset_threshold_breach(), self._lower_offset_addon()]):
self.aux_offset_adjustments[OffsetAdjustments.TemporarilyLowerOffset] = -2
net_adjustment = -2
else:
net_adjustment = 0
elif self._hvac.hub.sensors.peaqev_installed:
if self._hvac.hvac_dm <= self._hvac.hub.options.heating_options.low_degree_minutes and self._hvac.hub.sensors.average_temp_outdoors.value > -10:
self.aux_offset_adjustments[OffsetAdjustments.TemporarilyLowerOffset] = -1
if (self._hvac.hvac_dm <= self._hvac.hub.options.heating_options.low_degree_minutes
and self._hvac.hub.sensors.average_temp_outdoors.value > -10):
net_adjustment = -1
else:
net_adjustment = 0
else:
self.aux_offset_adjustments[OffsetAdjustments.TemporarilyLowerOffset] = 0
offsetdata.current_offset += self.aux_offset_adjustments[OffsetAdjustments.TemporarilyLowerOffset]
return True
net_adjustment = 0

last_adjustment = self.aux_offset_adjustments.get(OffsetAdjustments.TemporarilyLowerOffset, 0)
adjustment_difference = net_adjustment - last_adjustment
offsetdata.current_offset += adjustment_difference
self.aux_offset_adjustments[OffsetAdjustments.TemporarilyLowerOffset] = net_adjustment

return True

0 comments on commit 68ebb24

Please sign in to comment.