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
This commit is contained in:
Maikel Punie 2019-03-03 13:37:36 +01:00 committed by Andrew Sayre
parent 1e60993aa7
commit b985223603
3 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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