Add supervisor helper to start add-on (#40495)

This commit is contained in:
Martin Hjelmare 2020-09-23 17:05:28 +02:00 committed by GitHub
parent 40d003eccf
commit ccff7f97cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -158,6 +158,17 @@ async def async_uninstall_addon(hass: HomeAssistantType, slug: str) -> None:
await hassio.send_command(command)
@bind_hass
async def async_start_addon(hass: HomeAssistantType, slug: str) -> None:
"""Start add-on.
The caller of the function should handle HassioAPIError.
"""
hassio = hass.data[DOMAIN]
command = f"/addons/{slug}/start"
await hassio.send_command(command)
@callback
@bind_hass
def get_info(hass):