Skip to content

Commit 96408a9

Browse files
mrrstuxjclsn
authored andcommitted
Test setting operating mode while cooling.
1 parent 747cc69 commit 96408a9

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

tests/test_bosch.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
from unittest import mock
44

5-
from zigpy.zcl import foundation
6-
from zigpy.zcl.clusters.hvac import ControlSequenceOfOperation, Thermostat
7-
from zigpy.zcl.foundation import WriteAttributesStatusRecord
8-
95
import zhaquirks
106
from zhaquirks.bosch.rbsh_trv0_zb_eu import (
117
BoschOperatingMode,
128
BoschThermostatCluster as BoschTrvThermostatCluster,
139
)
10+
from zigpy.zcl import foundation
11+
from zigpy.zcl.clusters.hvac import ControlSequenceOfOperation, Thermostat
12+
from zigpy.zcl.foundation import WriteAttributesStatusRecord
1413

1514
zhaquirks.setup()
1615

@@ -347,6 +346,27 @@ def mock_read(attributes, manufacturer=None):
347346
== ControlSequenceOfOperation.Cooling_Only
348347
)
349348

349+
# -- operating_mode (by-id) in cooling mode
350+
success, fail = await bosch_thermostat_cluster.write_attributes(
351+
{
352+
BoschTrvThermostatCluster.AttributeDefs.operating_mode.id: BoschOperatingMode.Manual,
353+
}
354+
)
355+
assert success
356+
assert not fail
357+
assert (
358+
bosch_thermostat_cluster._attr_cache[
359+
BoschTrvThermostatCluster.AttributeDefs.operating_mode.id
360+
]
361+
== BoschOperatingMode.Manual
362+
)
363+
assert (
364+
bosch_thermostat_cluster._attr_cache[
365+
Thermostat.AttributeDefs.system_mode.id
366+
]
367+
== Thermostat.SystemMode.Cool
368+
)
369+
350370
# -- operating_mode (by-id) gets ignored when system_mode is written
351371
success, fail = await bosch_thermostat_cluster.write_attributes(
352372
{

0 commit comments

Comments
 (0)