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:
parent
6c91831baa
commit
9117fa6eb8
3 changed files with 14 additions and 20 deletions
|
@ -7,7 +7,6 @@ For more details about this platform, please refer to the documentation at
|
|||
https://home-assistant.io/components/sensor.mysensors/
|
||||
"""
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
|
@ -72,7 +71,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
v_types = [member for member in gateway.const.SetReq
|
||||
if member.value not in not_v_types]
|
||||
|
||||
devices = defaultdict(list)
|
||||
devices = {}
|
||||
gateway.platform_callbacks.append(mysensors.pf_callback_factory(
|
||||
s_types, v_types, devices, add_devices, MySensorsSensor))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue