mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add Supervisor restart add-on helper (#51717)
This commit is contained in:
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…
x
Reference in New Issue
Block a user