Add clear cache button to Fully Kiosk integration (#150943)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Christian
2025-08-26 12:20:43 +02:00
committed by GitHub
parent 060f748287
commit e5f163fa56
3 changed files with 20 additions and 0 deletions

View File

@@ -62,6 +62,12 @@ BUTTONS: tuple[FullyButtonEntityDescription, ...] = (
entity_category=EntityCategory.CONFIG,
press_action=lambda fully: fully.loadStartUrl(),
),
FullyButtonEntityDescription(
key="clearCache",
translation_key="clear_cache",
entity_category=EntityCategory.CONFIG,
press_action=lambda fully: fully.clearCache(),
),
)

View File

@@ -69,6 +69,9 @@
},
"load_start_url": {
"name": "Load start URL"
},
"clear_cache": {
"name": "Clear browser cache"
}
},
"image": {

View File

@@ -74,6 +74,17 @@ async def test_buttons(
)
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
device_entry = device_registry.async_get(entry.device_id)
assert device_entry