File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
homeassistant/components/fully_kiosk
tests/components/fully_kiosk Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,12 @@ class FullyButtonEntityDescription(ButtonEntityDescription):
6262 entity_category = EntityCategory .CONFIG ,
6363 press_action = lambda fully : fully .loadStartUrl (),
6464 ),
65+ FullyButtonEntityDescription (
66+ key = "clearCache" ,
67+ translation_key = "clear_cache" ,
68+ entity_category = EntityCategory .CONFIG ,
69+ press_action = lambda fully : fully .clearCache (),
70+ ),
6571)
6672
6773
Original file line number Diff line number Diff line change 6969 },
7070 "load_start_url" : {
7171 "name" : " Load start URL"
72+ },
73+ "clear_cache" : {
74+ "name" : " Clear browser cache"
7275 }
7376 },
7477 "image" : {
Original file line number Diff line number Diff line change @@ -74,6 +74,17 @@ async def test_buttons(
7474 )
7575 assert len (mock_fully_kiosk .loadStartUrl .mock_calls ) == 1
7676
77+ entry = entity_registry .async_get ("button.amazon_fire_clear_browser_cache" )
78+ assert entry
79+ assert entry .unique_id == "abcdef-123456-clearCache"
80+ await hass .services .async_call (
81+ button .DOMAIN ,
82+ button .SERVICE_PRESS ,
83+ {ATTR_ENTITY_ID : "button.amazon_fire_clear_browser_cache" },
84+ blocking = True ,
85+ )
86+ assert len (mock_fully_kiosk .clearCache .mock_calls ) == 1
87+
7788 assert entry .device_id
7889 device_entry = device_registry .async_get (entry .device_id )
7990 assert device_entry
You can’t perform that action at this time.
0 commit comments