From e34d821f7daf9fd92d22e6ad2256fbdfd3195d40 Mon Sep 17 00:00:00 2001 From: Martin Claesson <43297668+Claeysson@users.noreply.github.com> Date: Sun, 7 Jun 2026 21:29:51 +0200 Subject: [PATCH] Add Kiosker Clear Blackout Button (#173225) --- homeassistant/components/kiosker/button.py | 5 ++ homeassistant/components/kiosker/icons.json | 3 ++ homeassistant/components/kiosker/strings.json | 3 ++ .../kiosker/snapshots/test_button.ambr | 50 +++++++++++++++++++ tests/components/kiosker/test_button.py | 1 + 5 files changed, 62 insertions(+) diff --git a/homeassistant/components/kiosker/button.py b/homeassistant/components/kiosker/button.py index d9a3f20b4794..a4842c774ec1 100644 --- a/homeassistant/components/kiosker/button.py +++ b/homeassistant/components/kiosker/button.py @@ -72,6 +72,11 @@ BUTTONS: tuple[KioskerButtonEntityDescription, ...] = ( translation_key="screensaver_interact", action_fn=lambda api: api.screensaver_interact(), ), + KioskerButtonEntityDescription( + key="blackoutClear", + translation_key="blackout_clear", + action_fn=lambda api: api.blackout_clear(), + ), ) diff --git a/homeassistant/components/kiosker/icons.json b/homeassistant/components/kiosker/icons.json index 88693edd7acd..d1b58952f63f 100644 --- a/homeassistant/components/kiosker/icons.json +++ b/homeassistant/components/kiosker/icons.json @@ -15,6 +15,9 @@ } }, "button": { + "blackout_clear": { + "default": "mdi:monitor" + }, "clear_cache": { "default": "mdi:cached" }, diff --git a/homeassistant/components/kiosker/strings.json b/homeassistant/components/kiosker/strings.json index a282824099b6..8e63f276b585 100644 --- a/homeassistant/components/kiosker/strings.json +++ b/homeassistant/components/kiosker/strings.json @@ -57,6 +57,9 @@ } }, "button": { + "blackout_clear": { + "name": "Clear blackout" + }, "clear_cache": { "name": "Clear cache" }, diff --git a/tests/components/kiosker/snapshots/test_button.ambr b/tests/components/kiosker/snapshots/test_button.ambr index ae89eb5eed8f..f1c5a0b5be79 100644 --- a/tests/components/kiosker/snapshots/test_button.ambr +++ b/tests/components/kiosker/snapshots/test_button.ambr @@ -1,4 +1,54 @@ # serializer version: 1 +# name: test_all_entities[button.kiosker_a98be1ce_clear_blackout-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.kiosker_a98be1ce_clear_blackout', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Clear blackout', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Clear blackout', + 'platform': 'kiosker', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'blackout_clear', + 'unique_id': 'A98BE1CE-5FE7-4A8D-B2C3-123456789ABC_blackoutClear', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[button.kiosker_a98be1ce_clear_blackout-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Kiosker A98BE1CE Clear blackout', + }), + 'context': , + 'entity_id': 'button.kiosker_a98be1ce_clear_blackout', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_all_entities[button.kiosker_a98be1ce_clear_cache-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/kiosker/test_button.py b/tests/components/kiosker/test_button.py index 8f039a6b94cf..21b4271cb928 100644 --- a/tests/components/kiosker/test_button.py +++ b/tests/components/kiosker/test_button.py @@ -54,6 +54,7 @@ async def test_all_entities( ("button.kiosker_a98be1ce_clear_cache", "clear_cache"), ("button.kiosker_a98be1ce_clear_cookies", "clear_cookies"), ("button.kiosker_a98be1ce_dismiss_screensaver", "screensaver_interact"), + ("button.kiosker_a98be1ce_clear_blackout", "blackout_clear"), ], ) async def test_press_button(