Fix PEPE257 issues
This commit is contained in:
parent
49ebc6d0b0
commit
8bff97083c
49 changed files with 429 additions and 363 deletions
|
@ -1,9 +1,8 @@
|
|||
"""
|
||||
Contains functionality to use a ZigBee device as a sensor.
|
||||
Support for functionality to use a ZigBee device as a sensor.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.zigbee/
|
||||
|
||||
"""
|
||||
import logging
|
||||
from binascii import hexlify
|
||||
|
@ -18,7 +17,8 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""
|
||||
"""Setup the Z-Wave platform.
|
||||
|
||||
Uses the 'type' config value to work out which type of ZigBee sensor we're
|
||||
dealing with and instantiates the relevant classes to handle it.
|
||||
"""
|
||||
|
@ -36,8 +36,10 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
|
||||
|
||||
class ZigBeeTemperatureSensor(Entity):
|
||||
"""Allows usage of an XBee Pro as a temperature sensor."""
|
||||
"""Representation of XBee Pro temperature sensor."""
|
||||
|
||||
def __init__(self, hass, config):
|
||||
"""Initialize the sensor."""
|
||||
self._config = config
|
||||
self._temp = None
|
||||
# Get initial state
|
||||
|
@ -46,12 +48,12 @@ class ZigBeeTemperatureSensor(Entity):
|
|||
|
||||
@property
|
||||
def name(self):
|
||||
"""The name of the sensor."""
|
||||
"""Return the name of the sensor."""
|
||||
return self._config.name
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""Returns the state of the sensor."""
|
||||
"""Return the state of the sensor."""
|
||||
return self._temp
|
||||
|
||||
@property
|
||||
|
@ -60,7 +62,7 @@ class ZigBeeTemperatureSensor(Entity):
|
|||
return TEMP_CELCIUS
|
||||
|
||||
def update(self, *args):
|
||||
"""Gets the latest data."""
|
||||
"""Get the latest data."""
|
||||
try:
|
||||
self._temp = zigbee.DEVICE.get_temperature(self._config.address)
|
||||
except zigbee.ZIGBEE_TX_FAILURE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue