1
mirror of https://github.com/home-assistant/core synced 2024-09-03 08:14:07 +02:00

Add service to reboot the Freebox (#29525)

This commit is contained in:
SNoof85 2019-12-07 12:09:43 +01:00 committed by Martin Hjelmare
parent 9d7799c0af
commit ee657f3c2f
2 changed files with 11 additions and 0 deletions

View File

@ -71,6 +71,12 @@ async def async_setup_freebox(hass, config, host, port):
else:
hass.data[DATA_FREEBOX] = fbx
async def async_freebox_reboot(call):
"""Handle reboot service call."""
await fbx.system.reboot()
hass.services.async_register(DOMAIN, "reboot", async_freebox_reboot)
hass.async_create_task(async_load_platform(hass, "sensor", DOMAIN, {}, config))
hass.async_create_task(
async_load_platform(hass, "device_tracker", DOMAIN, {}, config)

View File

@ -0,0 +1,5 @@
# Freebox service entries description.
reboot:
# Description of the service
description: Reboots the Freebox.