Skip to content

Commit 3eec32d

Browse files
committed
Test for read extra attributes next to system mode.
1 parent 7b32e28 commit 3eec32d

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

tests/test_bosch.py

Lines changed: 25 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

@@ -451,6 +450,17 @@ def mock_read(attributes, manufacturer=None):
451450
assert not fail
452451
assert Thermostat.SystemMode.Off in success.values()
453452

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+
454464
# - system_mode by name
455465
success, fail = await bosch_thermostat_cluster.read_attributes(
456466
[Thermostat.AttributeDefs.system_mode.name]
@@ -459,6 +469,17 @@ def mock_read(attributes, manufacturer=None):
459469
assert not fail
460470
assert Thermostat.SystemMode.Off in success.values()
461471

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+
462483

463484
async def test_bosch_radiator_thermostat_II_read_attributes_manual_heat(
464485
zigpy_device_from_v2_quirk,

0 commit comments

Comments
 (0)