Add enable_day to duration selector (#68705)
parent
4e9430cba5
commit
a2a612c640
|
@ -207,7 +207,11 @@ class DurationSelector(Selector):
|
|||
|
||||
selector_type = "duration"
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({})
|
||||
CONFIG_SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Optional("enable_day"): cv.boolean,
|
||||
}
|
||||
)
|
||||
|
||||
def __call__(self, data: Any) -> dict[str, float]:
|
||||
"""Validate the passed selection."""
|
||||
|
|
|
@ -384,6 +384,11 @@ def test_attribute_selector_schema(schema, valid_selections, invalid_selections)
|
|||
({"seconds": 10},),
|
||||
(None, {}),
|
||||
),
|
||||
(
|
||||
{"enable_day": True},
|
||||
({"seconds": 10},),
|
||||
(None, {}),
|
||||
),
|
||||
),
|
||||
)
|
||||
def test_duration_selector_schema(schema, valid_selections, invalid_selections):
|
||||
|
|
Loading…
Reference in New Issue