Add support for specifying the integrations manifest/list fetches (#71982)

* Add support for specifying the integrations manifest/list fetches

See https://github.com/home-assistant/core/pull/71979 for
the motovation

* Update homeassistant/components/websocket_api/commands.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
J. Nick Koston 2022-05-17 01:22:56 -05:00 committed by GitHub
parent ddecf76f6f
commit 78f0716574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 3 deletions

View file

@ -1351,6 +1351,25 @@ async def test_manifest_list(hass, websocket_client):
]
async def test_manifest_list_specific_integrations(hass, websocket_client):
"""Test loading manifests for specific integrations."""
websocket_api = await async_get_integration(hass, "websocket_api")
await websocket_client.send_json(
{"id": 5, "type": "manifest/list", "integrations": ["hue", "websocket_api"]}
)
hue = await async_get_integration(hass, "hue")
msg = await websocket_client.receive_json()
assert msg["id"] == 5
assert msg["type"] == const.TYPE_RESULT
assert msg["success"]
assert sorted(msg["result"], key=lambda manifest: manifest["domain"]) == [
hue.manifest,
websocket_api.manifest,
]
async def test_manifest_get(hass, websocket_client):
"""Test getting a manifest."""
hue = await async_get_integration(hass, "hue")