This commit is contained in:
parent
613da308f2
commit
1855f1ae85
1 changed files with 5 additions and 3 deletions
|
@ -7,7 +7,8 @@ https://home-assistant.io/components/tellduslive/
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import ATTR_BATTERY_LEVEL, DEVICE_DEFAULT_NAME
|
from homeassistant.const import (
|
||||||
|
ATTR_BATTERY_LEVEL, DEVICE_DEFAULT_NAME, EVENT_HOMEASSISTANT_START)
|
||||||
from homeassistant.helpers import discovery
|
from homeassistant.helpers import discovery
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
@ -56,7 +57,8 @@ def setup(hass, config):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
hass.data[DOMAIN] = client
|
hass.data[DOMAIN] = client
|
||||||
client.update(utcnow())
|
|
||||||
|
hass.bus.listen(EVENT_HOMEASSISTANT_START, client.update)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -91,7 +93,7 @@ class TelldusLiveClient(object):
|
||||||
response = self._client.request_user()
|
response = self._client.request_user()
|
||||||
return response and 'email' in response
|
return response and 'email' in response
|
||||||
|
|
||||||
def update(self, now):
|
def update(self, *args):
|
||||||
"""Periodically poll the servers for current state."""
|
"""Periodically poll the servers for current state."""
|
||||||
_LOGGER.debug("Updating")
|
_LOGGER.debug("Updating")
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue