mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Allow setting number selector step size to 'any' (#78265)
* Allow setting number selector step size to 'any' * Improve test coverage
This commit is contained in:
@@ -241,6 +241,7 @@ def test_area_selector_schema(schema, valid_selections, invalid_selections):
|
||||
),
|
||||
({"min": 10, "max": 1000, "mode": "slider", "step": 0.5}, (), ()),
|
||||
({"mode": "box"}, (10,), ()),
|
||||
({"mode": "box", "step": "any"}, (), ()),
|
||||
),
|
||||
)
|
||||
def test_number_selector_schema(schema, valid_selections, invalid_selections):
|
||||
@@ -253,6 +254,12 @@ def test_number_selector_schema(schema, valid_selections, invalid_selections):
|
||||
(
|
||||
{}, # Must have mandatory fields
|
||||
{"mode": "slider"}, # Must have min+max in slider mode
|
||||
{
|
||||
"mode": "slider",
|
||||
"min": 0,
|
||||
"max": 1,
|
||||
"step": "any", # Can't combine slider with step any
|
||||
},
|
||||
),
|
||||
)
|
||||
def test_number_selector_schema_error(schema):
|
||||
|
||||
Reference in New Issue
Block a user