Add Supervisor restart add-on helper (#51717)
parent
d75c97cbf3
commit
a7f05713a0
|
@ -222,6 +222,18 @@ async def async_start_addon(hass: HomeAssistant, slug: str) -> dict:
|
|||
return await hassio.send_command(command, timeout=60)
|
||||
|
||||
|
||||
@bind_hass
|
||||
@api_data
|
||||
async def async_restart_addon(hass: HomeAssistant, slug: str) -> dict:
|
||||
"""Restart add-on.
|
||||
|
||||
The caller of the function should handle HassioAPIError.
|
||||
"""
|
||||
hassio = hass.data[DOMAIN]
|
||||
command = f"/addons/{slug}/restart"
|
||||
return await hassio.send_command(command, timeout=None)
|
||||
|
||||
|
||||
@bind_hass
|
||||
@api_data
|
||||
async def async_stop_addon(hass: HomeAssistant, slug: str) -> dict:
|
||||
|
|
Loading…
Reference in New Issue