Skip to content

Commit e48820b

Browse files
lbouefrenck
authored andcommitted
Matter pump setpoint CurrentLevel limit (#149689)
1 parent 2b7a434 commit e48820b

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

homeassistant/components/matter/number.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ def _update_from_device(self) -> None:
285285
native_min_value=0.5,
286286
native_step=0.5,
287287
device_to_ha=(
288-
lambda x: None if x is None else x / 2 # Matter range (1-200)
288+
lambda x: None
289+
if x is None
290+
else min(x, 200) / 2 # Matter range (1-200, capped at 200)
289291
),
290292
ha_to_device=lambda x: round(x * 2), # HA range 0.5–100.0%
291293
mode=NumberMode.SLIDER,

tests/components/matter/fixtures/nodes/pump.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
"1/6/65528": [],
204204
"1/6/65529": [0, 1, 2],
205205
"1/6/65531": [0, 65532, 65533, 65528, 65529, 65531],
206-
"1/8/0": 254,
206+
"1/8/0": 200,
207207
"1/8/15": 0,
208208
"1/8/17": 0,
209209
"1/8/65532": 0,

tests/components/matter/snapshots/test_number.ambr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2189,7 +2189,7 @@
21892189
'last_changed': <ANY>,
21902190
'last_reported': <ANY>,
21912191
'last_updated': <ANY>,
2192-
'state': '127.0',
2192+
'state': '100.0',
21932193
})
21942194
# ---
21952195
# name: test_numbers[silabs_laundrywasher][number.laundrywasher_temperature_setpoint-entry]

tests/components/matter/test_number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ async def test_pump_level(
172172
# CurrentLevel on LevelControl cluster
173173
state = hass.states.get("number.mock_pump_setpoint")
174174
assert state
175-
assert state.state == "127.0"
175+
assert state.state == "100.0"
176176

177177
set_node_attribute(matter_node, 1, 8, 0, 100)
178178
await trigger_subscription_callback(hass, matter_client)

0 commit comments

Comments
 (0)