mirror of
https://github.com/home-assistant/core.git
synced 2025-11-06 01:19:29 +00:00
Fix mysensors overwriting gateway in GATEWAYS (#4013)
GATEWAYS was a dict, so would overwrite item if key was the same. This would happen when using multiple MQTT gateways, since the device id is the same (`mqtt`). * Fix by changing GATEWAYS from dict into list. * Use hass data to store mysensors gateways instead of having GATEWAYS be a global.
This commit is contained in:
committed by
Paulus Schoutsen
parent
0c5e077091
commit
734bd75fd3
@@ -20,7 +20,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
if discovery_info is None:
|
||||
return
|
||||
|
||||
for gateway in mysensors.GATEWAYS.values():
|
||||
gateways = hass.data.get(mysensors.MYSENSORS_GATEWAYS)
|
||||
if not gateways:
|
||||
return
|
||||
|
||||
for gateway in gateways:
|
||||
# Define the S_TYPES and V_TYPES that the platform should handle as
|
||||
# states. Map them in a dict of lists.
|
||||
pres = gateway.const.Presentation
|
||||
|
||||
Reference in New Issue
Block a user