mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-08 17:56:33 +00:00
Correct /store/addons api output (#4589)
This commit is contained in:
parent
0cd7bd47bb
commit
fa90c247ec
@ -186,12 +186,14 @@ class APIStore(CoreSysAttributes):
|
|||||||
}
|
}
|
||||||
|
|
||||||
@api_process
|
@api_process
|
||||||
async def addons_list(self, request: web.Request) -> list[dict[str, Any]]:
|
async def addons_list(self, request: web.Request) -> dict[str, Any]:
|
||||||
"""Return all store add-ons."""
|
"""Return all store add-ons."""
|
||||||
return [
|
return {
|
||||||
self._generate_addon_information(self.sys_addons.store[addon])
|
ATTR_ADDONS: [
|
||||||
for addon in self.sys_addons.store
|
self._generate_addon_information(self.sys_addons.store[addon])
|
||||||
]
|
for addon in self.sys_addons.store
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
@api_process
|
@api_process
|
||||||
def addons_addon_install(self, request: web.Request) -> Awaitable[None]:
|
def addons_addon_install(self, request: web.Request) -> Awaitable[None]:
|
||||||
|
@ -50,7 +50,7 @@ async def test_api_store_addons(api_client: TestClient, store_addon: AddonStore)
|
|||||||
result = await resp.json()
|
result = await resp.json()
|
||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
assert result["data"][-1]["slug"] == store_addon.slug
|
assert result["data"]["addons"][-1]["slug"] == store_addon.slug
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
Loading…
x
Reference in New Issue
Block a user