mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 13:15:18 +02:00
Add accept keyword to Media selector (#145527)
* Add accept keyword to Media selector * Adjust test
This commit is contained in:
@@ -1125,7 +1125,7 @@ async def test_selector_serializer(
|
||||
"media_content_type": {"type": "string"},
|
||||
"metadata": {"type": "object", "additionalProperties": True},
|
||||
},
|
||||
"required": ["entity_id", "media_content_id", "media_content_type"],
|
||||
"required": ["media_content_id", "media_content_type"],
|
||||
}
|
||||
assert selector_serializer(selector.NumberSelector({"mode": "box"})) == {
|
||||
"type": "number"
|
||||
|
@@ -817,6 +817,23 @@ def test_theme_selector_schema(schema, valid_selections, invalid_selections) ->
|
||||
),
|
||||
(None, "abc", {}),
|
||||
),
|
||||
(
|
||||
{
|
||||
"accept": ["image/*"],
|
||||
},
|
||||
(
|
||||
{
|
||||
"media_content_id": "abc",
|
||||
"media_content_type": "def",
|
||||
},
|
||||
{
|
||||
"media_content_id": "abc",
|
||||
"media_content_type": "def",
|
||||
"metadata": {},
|
||||
},
|
||||
),
|
||||
(None, "abc", {}),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_media_selector_schema(schema, valid_selections, invalid_selections) -> None:
|
||||
|
Reference in New Issue
Block a user