Skip to content

Commit

Permalink
Test setting operating mode while cooling.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrrstux committed Jan 29, 2025
1 parent 384764d commit b8d6339
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions tests/test_bosch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

from unittest import mock

from zigpy.zcl import foundation
from zigpy.zcl.clusters.hvac import ControlSequenceOfOperation, Thermostat
from zigpy.zcl.foundation import WriteAttributesStatusRecord

import zhaquirks
from zhaquirks.bosch.rbsh_trv0_zb_eu import (
BoschOperatingMode,
BoschThermostatCluster as BoschTrvThermostatCluster,
)
from zigpy.zcl import foundation
from zigpy.zcl.clusters.hvac import ControlSequenceOfOperation, Thermostat
from zigpy.zcl.foundation import WriteAttributesStatusRecord

zhaquirks.setup()

Expand Down Expand Up @@ -347,6 +346,27 @@ def mock_read(attributes, manufacturer=None):
== ControlSequenceOfOperation.Cooling_Only
)

# -- operating_mode (by-id) in cooling mode
success, fail = await bosch_thermostat_cluster.write_attributes(
{
BoschTrvThermostatCluster.AttributeDefs.operating_mode.id: BoschOperatingMode.Manual,
}
)
assert success
assert not fail
assert (
bosch_thermostat_cluster._attr_cache[
BoschTrvThermostatCluster.AttributeDefs.operating_mode.id
]
== BoschOperatingMode.Manual
)
assert (
bosch_thermostat_cluster._attr_cache[
Thermostat.AttributeDefs.system_mode.id
]
== Thermostat.SystemMode.Cool
)

# -- operating_mode (by-id) gets ignored when system_mode is written
success, fail = await bosch_thermostat_cluster.write_attributes(
{
Expand Down

0 comments on commit b8d6339

Please sign in to comment.