mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Add screen on/off switch to Fully Kiosk Browser integration (#76957)
This commit is contained in:
parent
07ba3c1383
commit
1aef60c81c
@ -66,6 +66,13 @@ SWITCHES: tuple[FullySwitchEntityDescription, ...] = (
|
||||
off_action=lambda fully: fully.disableMotionDetection(),
|
||||
is_on_fn=lambda data: data["settings"].get("motionDetection"),
|
||||
),
|
||||
FullySwitchEntityDescription(
|
||||
key="screenOn",
|
||||
name="Screen",
|
||||
on_action=lambda fully: fully.screenOn(),
|
||||
off_action=lambda fully: fully.screenOff(),
|
||||
is_on_fn=lambda data: data.get("screenOn"),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
@ -61,6 +61,17 @@ async def test_switches(
|
||||
await call_service(hass, "turn_off", "switch.amazon_fire_motion_detection")
|
||||
assert len(mock_fully_kiosk.disableMotionDetection.mock_calls) == 1
|
||||
|
||||
entity = hass.states.get("switch.amazon_fire_screen")
|
||||
assert entity
|
||||
assert entity.state == "on"
|
||||
entry = entity_registry.async_get("switch.amazon_fire_screen")
|
||||
assert entry
|
||||
assert entry.unique_id == "abcdef-123456-screenOn"
|
||||
await call_service(hass, "turn_off", "switch.amazon_fire_screen")
|
||||
assert len(mock_fully_kiosk.screenOff.mock_calls) == 1
|
||||
await call_service(hass, "turn_on", "switch.amazon_fire_screen")
|
||||
assert len(mock_fully_kiosk.screenOn.mock_calls) == 1
|
||||
|
||||
assert entry.device_id
|
||||
device_entry = device_registry.async_get(entry.device_id)
|
||||
assert device_entry
|
||||
|
Loading…
x
Reference in New Issue
Block a user