diff --git a/custom_components/dual_smart_thermostat/managers/preset_manager.py b/custom_components/dual_smart_thermostat/managers/preset_manager.py index e9e217e..3528788 100644 --- a/custom_components/dual_smart_thermostat/managers/preset_manager.py +++ b/custom_components/dual_smart_thermostat/managers/preset_manager.py @@ -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) diff --git a/custom_components/dual_smart_thermostat/manifest.json b/custom_components/dual_smart_thermostat/manifest.json index f595d47..310b476 100644 --- a/custom_components/dual_smart_thermostat/manifest.json +++ b/custom_components/dual_smart_thermostat/manifest.json @@ -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" -} +} \ No newline at end of file