2
2
3
3
from unittest import mock
4
4
5
- from zigpy .zcl import foundation
6
- from zigpy .zcl .clusters .hvac import ControlSequenceOfOperation , Thermostat
7
- from zigpy .zcl .foundation import WriteAttributesStatusRecord
8
-
9
5
import zhaquirks
10
6
from zhaquirks .bosch .rbsh_trv0_zb_eu import (
11
7
BoschOperatingMode ,
12
8
BoschThermostatCluster as BoschTrvThermostatCluster ,
13
9
)
10
+ from zigpy .zcl import foundation
11
+ from zigpy .zcl .clusters .hvac import ControlSequenceOfOperation , Thermostat
12
+ from zigpy .zcl .foundation import WriteAttributesStatusRecord
14
13
15
14
zhaquirks .setup ()
16
15
@@ -58,7 +57,7 @@ def mock_read(attributes, manufacturer=None):
58
57
59
58
# check that system_mode ends-up writing operating_mode:
60
59
with patch_bosch_trv_write , patch_bosch_trv_read :
61
- # - Heating operation
60
+ # - Heating operation - by name
62
61
success , fail = await bosch_thermostat_cluster .write_attributes (
63
62
{"ctrl_sequence_of_oper" : ControlSequenceOfOperation .Heating_Only }
64
63
)
@@ -71,6 +70,21 @@ def mock_read(attributes, manufacturer=None):
71
70
== ControlSequenceOfOperation .Heating_Only
72
71
)
73
72
73
+ # - Heating operation - by id
74
+ success , fail = await bosch_thermostat_cluster .write_attributes (
75
+ {
76
+ Thermostat .AttributeDefs .ctrl_sequence_of_oper .id : ControlSequenceOfOperation .Heating_Only
77
+ }
78
+ )
79
+ assert success
80
+ assert not fail
81
+ assert (
82
+ bosch_thermostat_cluster ._attr_cache [
83
+ Thermostat .AttributeDefs .ctrl_sequence_of_oper .id
84
+ ]
85
+ == ControlSequenceOfOperation .Heating_Only
86
+ )
87
+
74
88
# -- Off (by-name)
75
89
success , fail = await bosch_thermostat_cluster .write_attributes (
76
90
{Thermostat .AttributeDefs .system_mode .name : Thermostat .SystemMode .Off }
0 commit comments