Skip to content

Commit

Permalink
Add the velbus sync clock service (#21308)
Browse files Browse the repository at this point in the history
* Add the velbus sync clock service

* Fixed houndci-bot commants

* Fix lint and pylint

* fixed all comments

* Hound bot comments

* Fix for flake8
  • Loading branch information
Cereal2nd authored and andrewsayre committed Mar 3, 2019
1 parent 1e60993 commit b985223
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion homeassistant/components/velbus/__init__.py
Expand Up @@ -7,7 +7,7 @@
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__)

Expand Down Expand Up @@ -62,7 +62,13 @@ def callback():
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

Expand Down
2 changes: 2 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -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
Expand Down

0 comments on commit b985223

Please sign in to comment.