Fix PEP8 and PEP257 issues (#11780)
This commit is contained in:
1 parent
48619c9d7c
commit
7fe2dafa04
5 files changed
+22
-27
No files matched your search
@@ -4,12 +4,11 @@ Support for deCONZ sensor.
|
||||
For more details about this component, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.deconz/
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
|
||||
from homeassistant.components.deconz import DOMAIN as DECONZ_DATA
|
||||
from homeassistant.const import ATTR_BATTERY_LEVEL, CONF_EVENT, CONF_ID
|
||||
from homeassistant.core import callback, EventOrigin
|
||||
from homeassistant.core import EventOrigin, callback
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.icon import icon_for_battery_level
|
||||
from homeassistant.util import slugify
|
||||
@@ -21,7 +20,7 @@ ATTR_EVENT_ID = 'event_id'
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Setup sensor for deCONZ component."""
|
||||
"""Set up the deCONZ sensors."""
|
||||
if discovery_info is None:
|
||||
return
|
||||
|
||||
@@ -45,7 +44,7 @@ class DeconzSensor(Entity):
|
||||
"""Representation of a sensor."""
|
||||
|
||||
def __init__(self, sensor):
|
||||
"""Setup sensor and add update callback to get data from websocket."""
|
||||
"""Set up sensor and add update callback to get data from websocket."""
|
||||
self._sensor = sensor
|
||||
|
||||
@asyncio.coroutine
|
||||
@@ -77,7 +76,7 @@ class DeconzSensor(Entity):
|
||||
|
||||
@property
|
||||
def device_class(self):
|
||||
"""Class of the sensor."""
|
||||
"""Return the class of the sensor."""
|
||||
return self._sensor.sensor_class
|
||||
|
||||
@property
|
||||
@@ -115,7 +114,7 @@ class DeconzBattery(Entity):
|
||||
def __init__(self, device):
|
||||
"""Register dispatcher callback for update of battery state."""
|
||||
self._device = device
|
||||
self._name = self._device.name + ' Battery Level'
|
||||
self._name = '{} {}'.format(self._device.name, 'Battery Level')
|
||||
self._device_class = 'battery'
|
||||
self._unit_of_measurement = "%"
|
||||
|
||||
@@ -142,7 +141,7 @@ class DeconzBattery(Entity):
|
||||
|
||||
@property
|
||||
def device_class(self):
|
||||
"""Class of the sensor."""
|
||||
"""Return the class of the sensor."""
|
||||
return self._device_class
|
||||
|
||||
@property
|
||||
|
||||
Reference in new issue
Block a user