mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
[Zwave] Add check for missing discovery_service
This commit is contained in:
parent
0c97280479
commit
5b4fc4f346
@ -31,6 +31,16 @@ DEVICE_MAPPINGS = {
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
""" Sets up Z-Wave sensors. """
|
||||
|
||||
# Return on empty `discovery_info`. Given you configure HA with:
|
||||
#
|
||||
# sensor:
|
||||
# platform: zwave
|
||||
#
|
||||
# `setup_platform` will be called without `discovery_info`.
|
||||
if discovery_info is None:
|
||||
return
|
||||
|
||||
node = zwave.NETWORK.nodes[discovery_info[zwave.ATTR_NODE_ID]]
|
||||
value = node.values[discovery_info[zwave.ATTR_VALUE_ID]]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user