mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Merge pull request #1440 from stefan-jonasson/fix-manufacturer-id
Fixed the z-wave sensor workarounds for empty manufacturer ids
This commit is contained in:
commit
87e23e7d73
@ -39,12 +39,15 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
||||
node = NETWORK.nodes[discovery_info[ATTR_NODE_ID]]
|
||||
value = node.values[discovery_info[ATTR_VALUE_ID]]
|
||||
value.set_change_verified(False)
|
||||
|
||||
# Make sure that we have values for the key before converting to int
|
||||
if (value.node.manufacturer_id.strip() and
|
||||
value.node.product_id.strip()):
|
||||
specific_sensor_key = (int(value.node.manufacturer_id, 16),
|
||||
int(value.node.product_id, 16),
|
||||
value.index)
|
||||
|
||||
value.set_change_verified(False)
|
||||
if specific_sensor_key in DEVICE_MAPPINGS:
|
||||
if DEVICE_MAPPINGS[specific_sensor_key] == WORKAROUND_NO_OFF_EVENT:
|
||||
# Default the multiplier to 4
|
||||
@ -53,8 +56,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
ZWaveTriggerSensor(value, "motion",
|
||||
hass, re_arm_multiplier * 8)
|
||||
])
|
||||
return
|
||||
|
||||
elif value.command_class == COMMAND_CLASS_SENSOR_BINARY:
|
||||
if value.command_class == COMMAND_CLASS_SENSOR_BINARY:
|
||||
add_devices([ZWaveBinarySensor(value, None)])
|
||||
|
||||
|
||||
|
@ -50,6 +50,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
# groups[1].associations):
|
||||
# node.groups[1].add_association(NETWORK.controller.node_id)
|
||||
|
||||
# Make sure that we have values for the key before converting to int
|
||||
if (value.node.manufacturer_id.strip() and
|
||||
value.node.product_id.strip()):
|
||||
specific_sensor_key = (int(value.node.manufacturer_id, 16),
|
||||
int(value.node.product_id, 16),
|
||||
value.index)
|
||||
@ -60,7 +63,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
return
|
||||
|
||||
# Generic Device mappings
|
||||
elif value.command_class == COMMAND_CLASS_SENSOR_MULTILEVEL:
|
||||
if value.command_class == COMMAND_CLASS_SENSOR_MULTILEVEL:
|
||||
add_devices([ZWaveMultilevelSensor(value)])
|
||||
|
||||
elif (value.command_class == COMMAND_CLASS_METER and
|
||||
|
Loading…
x
Reference in New Issue
Block a user