1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix PEPE257 issues

This commit is contained in:
Fabian Affolter
2016-03-08 16:46:34 +01:00
parent 49ebc6d0b0
commit 8bff97083c
49 changed files with 429 additions and 363 deletions

View File

@@ -30,8 +30,7 @@ DEVICE_MAPPINGS = {
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Sets up Z-Wave sensors."""
"""Setup Z-Wave sensors."""
# Return on empty `discovery_info`. Given you configure HA with:
#
# sensor:
@@ -75,9 +74,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class ZWaveSensor(ZWaveDeviceEntity, Entity):
"""Represents a Z-Wave sensor."""
"""Representation of a Z-Wave sensor."""
def __init__(self, sensor_value):
"""Initialize the sensor."""
from openzwave.network import ZWaveNetwork
from pydispatch import dispatcher
@@ -88,12 +88,12 @@ class ZWaveSensor(ZWaveDeviceEntity, Entity):
@property
def state(self):
"""Returns the state of the sensor."""
"""Return the state of the sensor."""
return self._value.data
@property
def unit_of_measurement(self):
"""Unit the value is expressed in."""
"""Return the unit of measurement the value is expressed in."""
return self._value.units
def value_changed(self, value):
@@ -103,10 +103,11 @@ class ZWaveSensor(ZWaveDeviceEntity, Entity):
class ZWaveMultilevelSensor(ZWaveSensor):
"""Represents a multi level sensor Z-Wave sensor."""
"""Representation of a multi level sensor Z-Wave sensor."""
@property
def state(self):
"""Returns the state of the sensor."""
"""Return the state of the sensor."""
value = self._value.data
if self._value.units in ('C', 'F'):
@@ -118,7 +119,7 @@ class ZWaveMultilevelSensor(ZWaveSensor):
@property
def unit_of_measurement(self):
"""Unit the value is expressed in."""
"""Return the unit the value is expressed in."""
unit = self._value.units
if unit == 'C':
@@ -130,8 +131,7 @@ class ZWaveMultilevelSensor(ZWaveSensor):
class ZWaveAlarmSensor(ZWaveSensor):
"""
A Z-wave sensor that sends Alarm alerts
"""Representation of a Z-Wave sensor that sends Alarm alerts.
Examples include certain Multisensors that have motion and vibration
capabilities. Z-Wave defines various alarm types such as Smoke, Flood,
@@ -141,4 +141,5 @@ class ZWaveAlarmSensor(ZWaveSensor):
COMMAND_CLASS_ALARM is what we get here.
"""
pass