Fix zwave_js addon info (#76044)

* Add add-on store info command

* Use add-on store info command in zwave_js

* Fix init tests

* Update tests

* Fix method for addon store info

* Fix response parsing

* Fix store addon installed response parsing

* Remove addon info log that can contain network keys

* Add supervisor store addon info test

* Default to version None if add-on not installed

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
This commit is contained in:
Martin Hjelmare 2022-08-03 22:33:05 +02:00 committed by GitHub
parent dd862595a3
commit 842cc060f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 32 deletions

View file

@ -223,12 +223,24 @@ HARDWARE_INTEGRATIONS = {
async def async_get_addon_info(hass: HomeAssistant, slug: str) -> dict:
"""Return add-on info.
The add-on must be installed.
The caller of the function should handle HassioAPIError.
"""
hassio = hass.data[DOMAIN]
return await hassio.get_addon_info(slug)
@api_data
async def async_get_addon_store_info(hass: HomeAssistant, slug: str) -> dict:
"""Return add-on store info.
The caller of the function should handle HassioAPIError.
"""
hassio: HassIO = hass.data[DOMAIN]
command = f"/store/addons/{slug}"
return await hassio.send_command(command, method="get")
@bind_hass
async def async_update_diagnostics(hass: HomeAssistant, diagnostics: bool) -> dict:
"""Update Supervisor diagnostics toggle.