Add Z-Wave battery level as a sensor. (#6341)
parent
b53bc24a63
commit
aa17481c94
|
@ -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 \
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue