Azure flake8 dep, docstring fixes (#25605)

* Fix Azure CI flake8 deps

* Docstyle fixes
This commit is contained in:
Ville Skyttä 2019-07-31 22:21:36 +03:00 committed by Paulus Schoutsen
parent 3cf8964c06
commit 0490167a12
8 changed files with 9 additions and 4 deletions

View File

@ -38,7 +38,7 @@ stages:
python -m venv venv
. venv/bin/activate
pip install flake8
pip install -r requirements_test.txt
displayName: 'Setup Env'
- script: |
. venv/bin/activate

View File

@ -174,7 +174,7 @@ class PublicTransportData():
self.info = []
def intersection(lst1, lst2):
"""Return items contained in both lists"""
"""Return items contained in both lists."""
return list(set(lst1) & set(lst2))
# Limit search to selected types, to get more results

View File

@ -147,7 +147,7 @@ class RingCam(Camera):
@property
def should_poll(self):
"""Updates controlled via the hub."""
"""Return False, updates are controlled via the hub."""
return False
def update(self):

View File

@ -109,7 +109,7 @@ class RingSensor(Entity):
@property
def should_poll(self):
"""Updates controlled via the hub."""
"""Return False, updates are controlled via the hub."""
return False
@property

View File

@ -204,6 +204,7 @@ class ZigbeeChannel(LogMixin):
return result.get(attribute)
def log(self, level, msg, *args):
"""Log a message."""
msg = '[%s]: ' + msg
args = (self.unique_id, ) + args
_LOGGER.log(level, msg, *args)
@ -301,6 +302,7 @@ class ZDOChannel(LogMixin):
self._status = ChannelStatus.CONFIGURED
def log(self, level, msg, *args):
"""Log a message."""
msg = '[%s:ZDO](%s): ' + msg
args = (self._zha_device.nwk, self._zha_device.model, ) + args
_LOGGER.log(level, msg, *args)

View File

@ -444,6 +444,7 @@ class ZHADevice(LogMixin):
return response
def log(self, level, msg, *args):
"""Log a message."""
msg = '[%s](%s): ' + msg
args = (self.nwk, self.model, ) + args
_LOGGER.log(level, msg, *args)

View File

@ -189,6 +189,7 @@ class ZhaEntity(RestoreEntity, LogMixin, entity.Entity):
self._unsubs.append(unsub)
def log(self, level, msg, *args):
"""Log a message."""
msg = '%s: ' + msg
args = (self.entity_id, ) + args
_LOGGER.log(level, msg, *args)

View File

@ -225,6 +225,7 @@ def test_discover_lights(hue_client):
@asyncio.coroutine
def test_light_without_brightness_supported(hass_hue, hue_client):
"""Test that light without brightness is supported."""
light_without_brightness_json = yield from perform_get_light_state(
hue_client, 'light.no_brightness', 200)