mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Add reboot_gateway service to Velux (#43198)
This commit is contained in:
parent
0fe3d6ea81
commit
48e899ca3a
@ -58,11 +58,18 @@ class VeluxModule:
|
|||||||
_LOGGER.debug("Velux interface terminated")
|
_LOGGER.debug("Velux interface terminated")
|
||||||
await self.pyvlx.disconnect()
|
await self.pyvlx.disconnect()
|
||||||
|
|
||||||
|
async def async_reboot_gateway(service_call):
|
||||||
|
await self.pyvlx.reboot_gateway()
|
||||||
|
|
||||||
self._hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
|
self._hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
|
||||||
host = self._domain_config.get(CONF_HOST)
|
host = self._domain_config.get(CONF_HOST)
|
||||||
password = self._domain_config.get(CONF_PASSWORD)
|
password = self._domain_config.get(CONF_PASSWORD)
|
||||||
self.pyvlx = PyVLX(host=host, password=password)
|
self.pyvlx = PyVLX(host=host, password=password)
|
||||||
|
|
||||||
|
self._hass.services.async_register(
|
||||||
|
DOMAIN, "reboot_gateway", async_reboot_gateway
|
||||||
|
)
|
||||||
|
|
||||||
async def async_start(self):
|
async def async_start(self):
|
||||||
"""Start velux component."""
|
"""Start velux component."""
|
||||||
_LOGGER.debug("Velux interface started")
|
_LOGGER.debug("Velux interface started")
|
||||||
|
4
homeassistant/components/velux/services.yaml
Normal file
4
homeassistant/components/velux/services.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Velux Integration services
|
||||||
|
|
||||||
|
reboot_gateway:
|
||||||
|
description: Reboots the KLF200 Gateway.
|
Loading…
x
Reference in New Issue
Block a user