From b985223603271601ac59732c5c505d35c4e94144 Mon Sep 17 00:00:00 2001 From: Maikel Punie Date: Sun, 3 Mar 2019 13:37:36 +0100 Subject: [PATCH] Add the velbus sync clock service (#21308) * Add the velbus sync clock service * Fixed houndci-bot commants * Fix lint and pylint * fixed all comments * Hound bot comments * Fix for flake8 --- homeassistant/components/velbus/__init__.py | 8 +++++++- homeassistant/components/velbus/services.yaml | 2 ++ requirements_all.txt | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 homeassistant/components/velbus/services.yaml diff --git a/homeassistant/components/velbus/__init__.py b/homeassistant/components/velbus/__init__.py index 38d8b6c3f1c..4e808dc21ca 100644 --- a/homeassistant/components/velbus/__init__.py +++ b/homeassistant/components/velbus/__init__.py @@ -7,7 +7,7 @@ from homeassistant.const import EVENT_HOMEASSISTANT_STOP, CONF_PORT from homeassistant.helpers.discovery import load_platform from homeassistant.helpers.entity import Entity -REQUIREMENTS = ['python-velbus==2.0.21'] +REQUIREMENTS = ['python-velbus==2.0.22'] _LOGGER = logging.getLogger(__name__) @@ -62,7 +62,13 @@ async def async_setup(hass, config): load_platform(hass, 'sensor', DOMAIN, discovery_info['sensor'], config) + def syn_clock(self, service=None): + controller.sync_clock() + controller.scan(callback) + hass.services.async_register( + DOMAIN, 'sync_clock', syn_clock, + schema=vol.Schema({})) return True diff --git a/homeassistant/components/velbus/services.yaml b/homeassistant/components/velbus/services.yaml new file mode 100644 index 00000000000..40916a08418 --- /dev/null +++ b/homeassistant/components/velbus/services.yaml @@ -0,0 +1,2 @@ +sync_clock: + description: Sync the velbus modules clock to the HASS clock, this is the same as the 'sync clock' from VelbusLink diff --git a/requirements_all.txt b/requirements_all.txt index e04c995e4f5..a2cd5936eae 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1385,7 +1385,7 @@ python-telegram-bot==11.1.0 python-twitch-client==0.6.0 # homeassistant.components.velbus -python-velbus==2.0.21 +python-velbus==2.0.22 # homeassistant.components.media_player.vlc python-vlc==1.1.2