mirror of
https://github.com/home-assistant/core.git
synced 2025-09-09 14:51:34 +02:00
Add clear cache button to Fully Kiosk integration (#150943)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -62,6 +62,12 @@ BUTTONS: tuple[FullyButtonEntityDescription, ...] = (
|
|||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
press_action=lambda fully: fully.loadStartUrl(),
|
press_action=lambda fully: fully.loadStartUrl(),
|
||||||
),
|
),
|
||||||
|
FullyButtonEntityDescription(
|
||||||
|
key="clearCache",
|
||||||
|
translation_key="clear_cache",
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
press_action=lambda fully: fully.clearCache(),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -69,6 +69,9 @@
|
|||||||
},
|
},
|
||||||
"load_start_url": {
|
"load_start_url": {
|
||||||
"name": "Load start URL"
|
"name": "Load start URL"
|
||||||
|
},
|
||||||
|
"clear_cache": {
|
||||||
|
"name": "Clear browser cache"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"image": {
|
"image": {
|
||||||
|
@@ -74,6 +74,17 @@ async def test_buttons(
|
|||||||
)
|
)
|
||||||
assert len(mock_fully_kiosk.loadStartUrl.mock_calls) == 1
|
assert len(mock_fully_kiosk.loadStartUrl.mock_calls) == 1
|
||||||
|
|
||||||
|
entry = entity_registry.async_get("button.amazon_fire_clear_browser_cache")
|
||||||
|
assert entry
|
||||||
|
assert entry.unique_id == "abcdef-123456-clearCache"
|
||||||
|
await hass.services.async_call(
|
||||||
|
button.DOMAIN,
|
||||||
|
button.SERVICE_PRESS,
|
||||||
|
{ATTR_ENTITY_ID: "button.amazon_fire_clear_browser_cache"},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
assert len(mock_fully_kiosk.clearCache.mock_calls) == 1
|
||||||
|
|
||||||
assert entry.device_id
|
assert entry.device_id
|
||||||
device_entry = device_registry.async_get(entry.device_id)
|
device_entry = device_registry.async_get(entry.device_id)
|
||||||
assert device_entry
|
assert device_entry
|
||||||
|
Reference in New Issue
Block a user