mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 20:40:18 +00:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user