mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 20:40:18 +00:00
Fix adding devices on the fly
Devices were not added without persistence enabled and restart of HA. Node id was added to defaultdict(list) by mistake when checking if list of defaultdict was empty. * Fix adding devices in mysensors_callback. * Change devices to regular dict.
This commit is contained in:
@@ -7,7 +7,6 @@ For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.mysensors.html
|
||||
"""
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
|
||||
from homeassistant.components.switch import SwitchDevice
|
||||
|
||||
@@ -54,7 +53,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
])
|
||||
v_types.extend([gateway.const.SetReq.V_STATUS, ])
|
||||
|
||||
devices = defaultdict(list)
|
||||
devices = {}
|
||||
gateway.platform_callbacks.append(mysensors.pf_callback_factory(
|
||||
s_types, v_types, devices, add_devices, MySensorsSwitch))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user