Skip to content

Commit

Permalink
test: covers better edge case 1
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Apr 10, 2024
1 parent 6db4a50 commit 2c7b0ab
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 88 deletions.
186 changes: 101 additions & 85 deletions config/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,54 +97,54 @@ switch:
entity_id: input_boolean.window_open

climate:
# - platform: dual_smart_thermostat
# name: Heat Cool Room
# unique_id: heat_cool_room
# heater: switch.heater
# cooler: switch.cooler
# openings:
# - input_boolean.window_open
# - input_boolean.window_open2
# target_sensor: sensor.room_temp
# floor_sensor: sensor.floor_temp
# min_temp: 15
# max_temp: 28
# target_temp: 23
# target_temp_high: 26
# target_temp_low: 23
# max_floor_temp: 28
# cold_tolerance: 0.3
# hot_tolerance: 0
# # min_cycle_duration:
# # seconds: 5
# # keep_alive:
# # minutes: 3
# heat_cool_mode: true
# initial_hvac_mode: "off"
# away_temp: 16
# precision: 0.1

# - platform: dual_smart_thermostat
# name: Heat Room
# unique_id: heat_room
# heater: switch.heater
# target_sensor: sensor.room_temp
# floor_sensor: sensor.floor_temp
# openings:
# - input_boolean.window_open
# - input_boolean.window_open2
# min_temp: 15
# max_temp: 28
# target_temp: 23
# cold_tolerance: 0.3
# hot_tolerance: 0
# min_cycle_duration:
# seconds: 5
# keep_alive:
# minutes: 3
# # initial_hvac_mode: "off"
# away_temp: 16
# precision: 0.1
- platform: dual_smart_thermostat
name: Heat Cool Room
unique_id: heat_cool_room
heater: switch.heater
cooler: switch.cooler
openings:
- input_boolean.window_open
- input_boolean.window_open2
target_sensor: sensor.room_temp
floor_sensor: sensor.floor_temp
min_temp: 15
max_temp: 28
target_temp: 23
target_temp_high: 26
target_temp_low: 23
max_floor_temp: 28
cold_tolerance: 0.3
hot_tolerance: 0
# min_cycle_duration:
# seconds: 5
# keep_alive:
# minutes: 3
heat_cool_mode: true
initial_hvac_mode: "off"
away_temp: 16
precision: 0.1

- platform: dual_smart_thermostat
name: Heat Room
unique_id: heat_room
heater: switch.heater
target_sensor: sensor.room_temp
floor_sensor: sensor.floor_temp
openings:
- input_boolean.window_open
- input_boolean.window_open2
min_temp: 15
max_temp: 28
target_temp: 23
cold_tolerance: 0.3
hot_tolerance: 0
min_cycle_duration:
seconds: 5
keep_alive:
minutes: 3
# initial_hvac_mode: "off"
away_temp: 16
precision: 0.1

- platform: dual_smart_thermostat
name: Cool Room
Expand All @@ -165,43 +165,59 @@ climate:
away_temp: 16
precision: 0.1

# - platform: dual_smart_thermostat
# name: AUX Heat Room
# entity_id: aux_heat_room
# heater: switch.heater
# secondary_heater: switch.aux_heater
# secondary_heater_timeout: 00:00:15
# secondary_heater_dual_mode: true
# openings:
# - input_boolean.window_open
# - input_boolean.window_open2
# target_sensor: sensor.room_temp
# away:
# temperature: 24
# anti_freeze:
# temperature: 10


# - platform: generic_thermostat
# name: generic one
# unique_id: generic_cool
# heater: switch.cooler
# ac_mode: true
# target_sensor: sensor.room_temp
# min_temp: 15
# max_temp: 28
# target_temp: 23
# target_temp_high: 26
# target_temp_low: 23
# cold_tolerance: 0.3
# hot_tolerance: 0
# min_cycle_duration:
# seconds: 5
# keep_alive:
# minutes: 3
# # initial_hvac_mode: "off"
# away_temp: 16
# precision: 0.1
- platform: dual_smart_thermostat
name: Edge Case 1
unique_id: edge_case_1
heater: switch.heater
cooler: switch.cooler
target_sensor: sensor.room_temp
min_cycle_duration: 60
precision: .5
min_temp: 20
max_temp: 25
heat_cool_mode: true
away:
target_temp_low: 0
target_temp_high: 50


- platform: dual_smart_thermostat
name: AUX Heat Room
entity_id: aux_heat_room
heater: switch.heater
secondary_heater: switch.aux_heater
secondary_heater_timeout: 00:00:15
secondary_heater_dual_mode: true
openings:
- input_boolean.window_open
- input_boolean.window_open2
target_sensor: sensor.room_temp
away:
temperature: 24
anti_freeze:
temperature: 10


- platform: generic_thermostat
name: generic one
unique_id: generic_cool
heater: switch.cooler
ac_mode: true
target_sensor: sensor.room_temp
min_temp: 15
max_temp: 28
target_temp: 23
target_temp_high: 26
target_temp_low: 23
cold_tolerance: 0.3
hot_tolerance: 0
min_cycle_duration:
seconds: 5
keep_alive:
minutes: 3
# initial_hvac_mode: "off"
away_temp: 16
precision: 0.1

logger:
default: error
Expand Down
6 changes: 3 additions & 3 deletions tests/test_dual_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ async def test_setup_gets_current_temp_from_sensor(
assert hass.states.get(common.ENTITY).attributes["current_temperature"] == 18


async def test_use_case_1(
# issue 80
async def test_presets_use_case_1(
hass: HomeAssistant,
) -> None: # noqa: F811
"""Test that current temperature is updated on entity addition."""
Expand All @@ -175,8 +176,6 @@ async def test_use_case_1(
"min_temp": 20,
"max_temp": 25,
"heat_cool_mode": True,
"target_temp_high": 30,
"target_temp_low": 10,
PRESET_AWAY: {
"target_temp_low": 0,
"target_temp_high": 50,
Expand All @@ -188,6 +187,7 @@ async def test_use_case_1(

state = hass.states.get(common.ENTITY)
assert state.attributes["supported_features"] == 402
assert state.attributes["preset_modes"] == [PRESET_NONE, PRESET_AWAY]

await common.async_set_preset_mode(hass, PRESET_AWAY)

Expand Down

0 comments on commit 2c7b0ab

Please sign in to comment.