Filter rfxtrx configure devices option flow on existing config entry (#40975)
* Prompt only configure devices when device is in config entry * Fix copy
This commit is contained in:
parent
b6855816ed
commit
c16f107f6b
2 changed files with 18 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
|||
import asyncio
|
||||
import binascii
|
||||
from collections import OrderedDict
|
||||
import copy
|
||||
import logging
|
||||
|
||||
import RFXtrx as rfxtrxmod
|
||||
|
@ -304,6 +305,7 @@ async def async_setup_internal(hass, entry: config_entries.ConfigEntry):
|
|||
config[CONF_DEVICE_ID] = device_id
|
||||
|
||||
data = entry.data.copy()
|
||||
data[CONF_DEVICES] = copy.deepcopy(entry.data[CONF_DEVICES])
|
||||
event_code = binascii.hexlify(event.data).decode("ASCII")
|
||||
data[CONF_DEVICES][event_code] = config
|
||||
hass.config_entries.async_update_entry(entry=entry, data=data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue