mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Add CancelBoost for Matter Water heater (#145316)
* Update water_heater.py Add CancelBoost * Add test for CancelBoost * Update water_heater.py
This commit is contained in:
parent
9e7ae1daa4
commit
12b5dbdd83
@ -108,6 +108,11 @@ class MatterWaterHeater(MatterEntity, WaterHeaterEntity):
|
|||||||
await self.send_device_command(
|
await self.send_device_command(
|
||||||
clusters.WaterHeaterManagement.Commands.Boost(boostInfo=boost_info)
|
clusters.WaterHeaterManagement.Commands.Boost(boostInfo=boost_info)
|
||||||
)
|
)
|
||||||
|
# Trigger CancelBoost command for other modes
|
||||||
|
else:
|
||||||
|
await self.send_device_command(
|
||||||
|
clusters.WaterHeaterManagement.Commands.CancelBoost()
|
||||||
|
)
|
||||||
|
|
||||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
"""Turn on water heater."""
|
"""Turn on water heater."""
|
||||||
|
@ -166,6 +166,32 @@ async def test_water_heater_boostmode(
|
|||||||
command=clusters.WaterHeaterManagement.Commands.Boost(boostInfo=boost_info),
|
command=clusters.WaterHeaterManagement.Commands.Boost(boostInfo=boost_info),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# disable water_heater boostmode
|
||||||
|
await hass.services.async_call(
|
||||||
|
"water_heater",
|
||||||
|
"set_operation_mode",
|
||||||
|
{
|
||||||
|
"entity_id": "water_heater.water_heater",
|
||||||
|
"operation_mode": STATE_ECO,
|
||||||
|
},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
assert matter_client.write_attribute.call_count == 2
|
||||||
|
assert matter_client.write_attribute.call_args == call(
|
||||||
|
node_id=matter_node.node_id,
|
||||||
|
attribute_path=create_attribute_path_from_attribute(
|
||||||
|
endpoint_id=2,
|
||||||
|
attribute=clusters.Thermostat.Attributes.SystemMode,
|
||||||
|
),
|
||||||
|
value=4,
|
||||||
|
)
|
||||||
|
assert matter_client.send_device_command.call_count == 2
|
||||||
|
assert matter_client.send_device_command.call_args == call(
|
||||||
|
node_id=matter_node.node_id,
|
||||||
|
endpoint_id=2,
|
||||||
|
command=clusters.WaterHeaterManagement.Commands.CancelBoost(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("node_fixture", ["silabs_water_heater"])
|
@pytest.mark.parametrize("node_fixture", ["silabs_water_heater"])
|
||||||
async def test_update_from_water_heater(
|
async def test_update_from_water_heater(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user