Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Dec 11, 2024
2 parents f93e70f + c5e61c1 commit 4f02851
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
26 changes: 16 additions & 10 deletions custom_components/dual_smart_thermostat/managers/preset_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,22 @@ def apply_old_state(self, old_state: State):
)
self._environment.saved_target_temp = float(old_temperature)

self._environment.target_temp_low = (
float(old_target_temp_low)
if old_target_temp_low
else float(preset.to_dict.get(ATTR_TARGET_TEMP_LOW))
)
self._environment.target_temp_high = (
float(old_target_temp_high)
if old_target_temp_high
else float(preset.to_dict.get(ATTR_TARGET_TEMP_HIGH))
)
preset_target_temp_low = preset.to_dict.get(ATTR_TARGET_TEMP_LOW)
preset_target_temp_high = preset.to_dict.get(ATTR_TARGET_TEMP_HIGH)

if preset_target_temp_low is not None:
self._environment.target_temp_low = (
float(old_target_temp_low)
if old_target_temp_low
else float(preset_target_temp_low)
)

if preset_target_temp_high is not None:
self._environment.target_temp_high = (
float(old_target_temp_high)
if old_target_temp_high
else float(preset_target_temp_high)
)

elif self._preset_modes and old_pres_mode in self._presets:
_LOGGER.debug("Restoring previous preset mode target: %s", old_pres_mode)
Expand Down
7 changes: 5 additions & 2 deletions custom_components/dual_smart_thermostat/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
"dependencies": [
"climate",
"sensor",
"switch"
"switch",
"input_select",
"input_boolean",
"input_number"
],
"documentation": "https://github.com/swingerman/ha-dual-smart-thermostat.git",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/swingerman/ha-dual-smart-thermostat/issues",
"requirements": [],
"version": "v0.9.9"
}
}

0 comments on commit 4f02851

Please sign in to comment.