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
@@ -451,6 +450,17 @@ def mock_read(attributes, manufacturer=None):
451
450
assert not fail
452
451
assert Thermostat .SystemMode .Off in success .values ()
453
452
453
+ # - system_mode by id along other attributes
454
+ success , fail = await bosch_thermostat_cluster .read_attributes (
455
+ [
456
+ Thermostat .AttributeDefs .system_mode .id ,
457
+ Thermostat .AttributeDefs .pi_heating_demand .id ,
458
+ ]
459
+ )
460
+ assert success
461
+ assert not fail
462
+ assert Thermostat .SystemMode .Off in success .values ()
463
+
454
464
# - system_mode by name
455
465
success , fail = await bosch_thermostat_cluster .read_attributes (
456
466
[Thermostat .AttributeDefs .system_mode .name ]
@@ -459,6 +469,17 @@ def mock_read(attributes, manufacturer=None):
459
469
assert not fail
460
470
assert Thermostat .SystemMode .Off in success .values ()
461
471
472
+ # - system_mode by name along other attributes
473
+ success , fail = await bosch_thermostat_cluster .read_attributes (
474
+ [
475
+ Thermostat .AttributeDefs .system_mode .name ,
476
+ Thermostat .AttributeDefs .pi_heating_demand .name ,
477
+ ]
478
+ )
479
+ assert success
480
+ assert not fail
481
+ assert Thermostat .SystemMode .Off in success .values ()
482
+
462
483
463
484
async def test_bosch_radiator_thermostat_II_read_attributes_manual_heat (
464
485
zigpy_device_from_v2_quirk ,
0 commit comments