Update docstrings (#7361)

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update tomato.py

* Update isy994.py

* Lint + fix tests

* Lint
This commit is contained in:
Fabian Affolter 2017-04-30 07:04:49 +02:00 committed by Paulus Schoutsen
parent e22e70a01a
commit 3ee4d1060f
264 changed files with 1686 additions and 1768 deletions

View file

@ -46,14 +46,13 @@ ATTR_LAST_UPDATED = 'time_last_updated'
def setup(hass, config):
"""Setup the Telldus Live component."""
"""Set up the Telldus Live component."""
client = TelldusLiveClient(hass, config)
if not client.validate_session():
_LOGGER.error(
'Authentication Error: '
'Please make sure you have configured your keys '
'that can be aquired from https://api.telldus.com/keys/index')
"Authentication Error: Please make sure you have configured your "
"keys that can be aquired from https://api.telldus.com/keys/index")
return False
hass.data[DOMAIN] = client
@ -94,7 +93,7 @@ class TelldusLiveClient(object):
def update(self, now):
"""Periodically poll the servers for current state."""
_LOGGER.debug('Updating')
_LOGGER.debug("Updating")
try:
self._sync()
finally:
@ -104,7 +103,7 @@ class TelldusLiveClient(object):
def _sync(self):
"""Update local list of devices."""
if not self._client.update():
_LOGGER.warning('Failed request')
_LOGGER.warning("Failed request")
def identify_device(device):
"""Find out what type of HA component to create."""
@ -116,8 +115,8 @@ class TelldusLiveClient(object):
elif device.methods & TURNON:
return 'switch'
else:
_LOGGER.warning('Unidentified device type (methods: %d)',
device.methods)
_LOGGER.warning(
"Unidentified device type (methods: %d)", device.methods)
return 'switch'
def discover(device_id, component):
@ -158,10 +157,10 @@ class TelldusLiveEntity(Entity):
self._client = hass.data[DOMAIN]
self._client.entities.append(self)
self._name = self.device.name
_LOGGER.debug('Created device %s', self)
_LOGGER.debug("Created device %s", self)
def changed(self):
"""A property of the device might have changed."""
"""Return the property of the device might have changed."""
if self.device.name:
self._name = self.device.name
self.schedule_update_ha_state()
@ -183,7 +182,7 @@ class TelldusLiveEntity(Entity):
@property
def should_poll(self):
"""Polling is not needed."""
"""Return the polling state."""
return False
@property