mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
Make default theme selectable for set theme service (#96849)
This commit is contained in:
parent
6bd4ace3c3
commit
d8c989f732
@ -11,6 +11,7 @@ set_theme:
|
|||||||
example: "default"
|
example: "default"
|
||||||
selector:
|
selector:
|
||||||
theme:
|
theme:
|
||||||
|
include_default: true
|
||||||
mode:
|
mode:
|
||||||
name: Mode
|
name: Mode
|
||||||
description: The mode the theme is for.
|
description: The mode the theme is for.
|
||||||
|
@ -1201,7 +1201,11 @@ class ThemeSelector(Selector[ThemeSelectorConfig]):
|
|||||||
|
|
||||||
selector_type = "theme"
|
selector_type = "theme"
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema({})
|
CONFIG_SCHEMA = vol.Schema(
|
||||||
|
{
|
||||||
|
vol.Optional("include_default", default=False): cv.boolean,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def __init__(self, config: ThemeSelectorConfig | None = None) -> None:
|
def __init__(self, config: ThemeSelectorConfig | None = None) -> None:
|
||||||
"""Instantiate a selector."""
|
"""Instantiate a selector."""
|
||||||
|
@ -747,6 +747,11 @@ def test_icon_selector_schema(schema, valid_selections, invalid_selections) -> N
|
|||||||
("abc",),
|
("abc",),
|
||||||
(None,),
|
(None,),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
{"include_default": True},
|
||||||
|
("abc",),
|
||||||
|
(None,),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
def test_theme_selector_schema(schema, valid_selections, invalid_selections) -> None:
|
def test_theme_selector_schema(schema, valid_selections, invalid_selections) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user