Add Matter Pump device type (#145335)

* Pump status

* Pump speed

* PumpStatusRunning

* ControlModeEnum

* Add tests

* Clean code

* Update tests and sensors

* Review fixes

* Add RPM unit

* Fix for unknown value

* Update snapshot

* OperationMode

* Update snapshots

* Update snapshot

* Update tests/components/matter/test_select.py

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>

* Handle SupplyFault bit enabled too

* Review fix

* Unmove

* Remove pump_operation_mode

* Update snapshot

---------

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
This commit is contained in:
Ludovic BOUÉ
2025-05-23 17:20:27 +02:00
committed by GitHub
parent ed0ff93d1e
commit e22ea85e84
12 changed files with 501 additions and 1 deletions

View File

@@ -523,3 +523,35 @@ async def test_water_heater(
state = hass.states.get("sensor.water_heater_appliance_energy_state")
assert state
assert state.state == "offline"
@pytest.mark.parametrize("node_fixture", ["pump"])
async def test_pump(
hass: HomeAssistant,
matter_client: MagicMock,
matter_node: MatterNode,
) -> None:
"""Test pump sensors."""
# ControlMode
state = hass.states.get("sensor.mock_pump_control_mode")
assert state
assert state.state == "constant_temperature"
set_node_attribute(matter_node, 1, 512, 33, 7)
await trigger_subscription_callback(hass, matter_client)
state = hass.states.get("sensor.mock_pump_control_mode")
assert state
assert state.state == "automatic"
# Speed
state = hass.states.get("sensor.mock_pump_rotation_speed")
assert state
assert state.state == "1000"
set_node_attribute(matter_node, 1, 512, 20, 500)
await trigger_subscription_callback(hass, matter_client)
state = hass.states.get("sensor.mock_pump_rotation_speed")
assert state
assert state.state == "500"