Skip to content

Commit

Permalink
fix: separates dual and heat-cool mode
Browse files Browse the repository at this point in the history
  • Loading branch information
= authored and swingerman committed Apr 23, 2024
1 parent 37b66c8 commit dd67d9f
Show file tree
Hide file tree
Showing 9 changed files with 592 additions and 196 deletions.
28 changes: 24 additions & 4 deletions config/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,26 @@ climate:
cold_tolerance: 1.0
hot_tolerance: 1.0

- platform: dual_smart_thermostat
name: Edge Case 155
unique_id: edge_case_155
heater: switch.heater
cooler: switch.cooler
target_sensor: sensor.room_temp
openings:
- input_boolean.window_open
- input_boolean.window_open2
openings_scope:
- heat
min_temp: 18
max_temp: 27
target_temp: 23.0
hot_tolerance: 0
cold_tolerance: 0.20
precision: 0.1
target_temp_step: 0.5
initial_hvac_mode: heat

- platform: dual_smart_thermostat
name: AUX Heat Room
unique_id: aux_heat_room
Expand All @@ -227,8 +247,8 @@ climate:
unique_id: fan_cool_room
heater: switch.heater
fan: switch.fan
fan_cool_tolerance: 2
fan_turn_on_with_cooler: true
fan_hot_tolerance: 2
fan_on_with_ac: true
ac_mode: true
target_sensor: sensor.room_temp
min_temp: 18
Expand All @@ -238,8 +258,8 @@ climate:
name: FAN Only Room
unique_id: fan_only_room
fan: switch.fan
fan_cool_tolerance: 2
fan_turn_on_with_cooler: true
fan_hot_tolerance: 2
fan_on_with_ac: true
target_sensor: sensor.room_temp

# - platform: generic_thermostat
Expand Down
5 changes: 3 additions & 2 deletions custom_components/dual_smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ async def async_setup_platform(

preset_manager = PresetManager(hass, config, temperature_manager, feature_manager)

device_factory = HVACDeviceFactory(hass, config)
device_factory = HVACDeviceFactory(hass, config, feature_manager)

hvac_device = device_factory.create_device(temperature_manager, opening_manager)

Expand Down Expand Up @@ -639,8 +639,9 @@ def extra_state_attributes(self) -> dict:
def _set_support_flags(self) -> None:
self.features.set_support_flags(
self.presets.presets,
self.hvac_device.hvac_modes,
self.presets.presets_range,
self.presets.preset_mode,
self.hvac_device.hvac_modes,
self._hvac_mode,
)
self._attr_supported_features = self.features.supported_features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(
heater_device: HeaterDevice,
cooler_device: CoolerDevice,
initial_hvac_mode: HVACMode,
heat_cool_mode: bool,
temperatures: TemperatureManager,
openings: OpeningManager,
) -> None:
Expand All @@ -51,7 +52,10 @@ def __init__(
heater_device.hvac_modes, cooler_device.hvac_modes
)

self.hvac_modes = merge_hvac_modes(device_hvac_modes, [HVACMode.HEAT_COOL])
if heat_cool_mode:
self.hvac_modes = merge_hvac_modes(device_hvac_modes, [HVACMode.HEAT_COOL])
else:
self.hvac_modes = device_hvac_modes

if initial_hvac_mode in self.hvac_modes:
self._hvac_mode = initial_hvac_mode
Expand Down
Loading

0 comments on commit dd67d9f

Please sign in to comment.