From e5f163fa569a1cef520cc8fd971ec9f1b9ee9b62 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 26 Aug 2025 12:20:43 +0200 Subject: [PATCH] Add clear cache button to Fully Kiosk integration (#150943) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- homeassistant/components/fully_kiosk/button.py | 6 ++++++ homeassistant/components/fully_kiosk/strings.json | 3 +++ tests/components/fully_kiosk/test_button.py | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/homeassistant/components/fully_kiosk/button.py b/homeassistant/components/fully_kiosk/button.py index 112ead983b9..625a965a0da 100644 --- a/homeassistant/components/fully_kiosk/button.py +++ b/homeassistant/components/fully_kiosk/button.py @@ -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(), + ), ) diff --git a/homeassistant/components/fully_kiosk/strings.json b/homeassistant/components/fully_kiosk/strings.json index fdfdf7910ae..fd7eaecd446 100644 --- a/homeassistant/components/fully_kiosk/strings.json +++ b/homeassistant/components/fully_kiosk/strings.json @@ -69,6 +69,9 @@ }, "load_start_url": { "name": "Load start URL" + }, + "clear_cache": { + "name": "Clear browser cache" } }, "image": { diff --git a/tests/components/fully_kiosk/test_button.py b/tests/components/fully_kiosk/test_button.py index 4652ee96047..e263cbc7082 100644 --- a/tests/components/fully_kiosk/test_button.py +++ b/tests/components/fully_kiosk/test_button.py @@ -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