Add Z-Wave battery level as a sensor. (#6341)

pull/6372/head
Andrey 2017-03-03 09:19:06 +02:00 committed by GitHub
parent b53bc24a63
commit aa17481c94
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,8 @@ _LOGGER = logging.getLogger(__name__)
def get_device(node, value, **kwargs):
"""Create zwave entity device."""
# Generic Device mappings
if value.command_class == zwave.const.COMMAND_CLASS_BATTERY:
return ZWaveSensor(value)
if node.has_command_class(zwave.const.COMMAND_CLASS_SENSOR_MULTILEVEL):
return ZWaveMultilevelSensor(value)
if node.has_command_class(zwave.const.COMMAND_CLASS_METER) and \

View File

@ -70,7 +70,8 @@ DISCOVERY_COMPONENTS = [
[const.COMMAND_CLASS_SENSOR_MULTILEVEL,
const.COMMAND_CLASS_METER,
const.COMMAND_CLASS_ALARM,
const.COMMAND_CLASS_SENSOR_ALARM],
const.COMMAND_CLASS_SENSOR_ALARM,
const.COMMAND_CLASS_BATTERY],
const.TYPE_WHATEVER,
const.GENRE_USER),
('light',