ZWave alarm sensor cleanup (pylint fixes)
This commit is contained in:
parent
2495226c87
commit
5af4864326
2 changed files with 15 additions and 13 deletions
|
@ -73,7 +73,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
elif (value.command_class == zwave.COMMAND_CLASS_METER and
|
elif (value.command_class == zwave.COMMAND_CLASS_METER and
|
||||||
value.type == zwave.TYPE_DECIMAL):
|
value.type == zwave.TYPE_DECIMAL):
|
||||||
add_devices([ZWaveMultilevelSensor(value)])
|
add_devices([ZWaveMultilevelSensor(value)])
|
||||||
|
|
||||||
elif value.command_class == zwave.COMMAND_CLASS_ALARM:
|
elif value.command_class == zwave.COMMAND_CLASS_ALARM:
|
||||||
add_devices([ZWaveAlarmSensor(value)])
|
add_devices([ZWaveAlarmSensor(value)])
|
||||||
|
|
||||||
|
@ -220,16 +220,18 @@ class ZWaveMultilevelSensor(ZWaveSensor):
|
||||||
else:
|
else:
|
||||||
return unit
|
return unit
|
||||||
|
|
||||||
|
|
||||||
class ZWaveAlarmSensor(ZWaveSensor):
|
class ZWaveAlarmSensor(ZWaveSensor):
|
||||||
""" A Z-wave sensor that sends Alarm alerts
|
""" A Z-wave sensor that sends Alarm alerts
|
||||||
|
|
||||||
Examples include certain Multisensors that have motion and vibration capabilities.
|
Examples include certain Multisensors that have motion and
|
||||||
Z-Wave defines various alarm types such as Smoke, Flood, Burglar, CarbonMonoxide, etc.
|
vibration capabilities. Z-Wave defines various alarm types
|
||||||
This wraps these events.
|
such as Smoke, Flood, Burglar, CarbonMonoxide, etc.
|
||||||
|
|
||||||
COMMAND_CLASS_ALARM is what we get here.
|
This wraps these alarms and allows you to use them to
|
||||||
|
trigger things, etc.
|
||||||
|
|
||||||
|
COMMAND_CLASS_ALARM is what we get here.
|
||||||
"""
|
"""
|
||||||
@property
|
# Empty subclass for now. Allows for later customizations
|
||||||
def state(self):
|
pass
|
||||||
""" Returns the state of the sensor. """
|
|
||||||
return str(self._value.data)
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ COMMAND_CLASS_SENSOR_BINARY = 48
|
||||||
COMMAND_CLASS_SENSOR_MULTILEVEL = 49
|
COMMAND_CLASS_SENSOR_MULTILEVEL = 49
|
||||||
COMMAND_CLASS_METER = 50
|
COMMAND_CLASS_METER = 50
|
||||||
COMMAND_CLASS_BATTERY = 128
|
COMMAND_CLASS_BATTERY = 128
|
||||||
COMMAND_CLASS_ALARM = 113 # 0x71
|
COMMAND_CLASS_ALARM = 113 # 0x71
|
||||||
|
|
||||||
GENRE_WHATEVER = None
|
GENRE_WHATEVER = None
|
||||||
GENRE_USER = "User"
|
GENRE_USER = "User"
|
||||||
|
|
Loading…
Add table
Reference in a new issue