Add Status indicator light switch to Roborock (#93842)
add status indicator light switch
This commit is contained in:
parent
676b6ab706
commit
1d7498378e
3 changed files with 16 additions and 1 deletions
|
@ -100,6 +100,9 @@
|
|||
"switch": {
|
||||
"child_lock": {
|
||||
"name": "Child lock"
|
||||
},
|
||||
"status_indicator": {
|
||||
"name": "Status indicator light"
|
||||
}
|
||||
},
|
||||
"vacuum": {
|
||||
|
|
|
@ -50,7 +50,18 @@ SWITCH_DESCRIPTIONS: list[RoborockSwitchDescription] = [
|
|||
translation_key="child_lock",
|
||||
icon="mdi:account-lock",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
)
|
||||
),
|
||||
RoborockSwitchDescription(
|
||||
set_command=lambda entity, value: entity.send(
|
||||
RoborockCommand.SET_FLOW_LED_STATUS, {"status": 1 if value else 0}
|
||||
),
|
||||
get_value=lambda data: data.send(RoborockCommand.GET_FLOW_LED_STATUS),
|
||||
evaluate_value=lambda data: data["status"] == 1,
|
||||
key="status_indicator",
|
||||
translation_key="status_indicator",
|
||||
icon="mdi:alarm-light-outline",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ from tests.common import MockConfigEntry
|
|||
("entity_id"),
|
||||
[
|
||||
("switch.roborock_s7_maxv_child_lock"),
|
||||
("switch.roborock_s7_maxv_status_indicator_light"),
|
||||
],
|
||||
)
|
||||
async def test_update_success(
|
||||
|
|
Loading…
Add table
Reference in a new issue