mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Fix setting up options due to config data freeze (#32872)
This commit is contained in:
parent
9146f76b01
commit
576970d1ad
@ -332,16 +332,17 @@ class MikrotikHub:
|
|||||||
async def async_add_options(self):
|
async def async_add_options(self):
|
||||||
"""Populate default options for Mikrotik."""
|
"""Populate default options for Mikrotik."""
|
||||||
if not self.config_entry.options:
|
if not self.config_entry.options:
|
||||||
|
data = dict(self.config_entry.data)
|
||||||
options = {
|
options = {
|
||||||
CONF_ARP_PING: self.config_entry.data.pop(CONF_ARP_PING, False),
|
CONF_ARP_PING: data.pop(CONF_ARP_PING, False),
|
||||||
CONF_FORCE_DHCP: self.config_entry.data.pop(CONF_FORCE_DHCP, False),
|
CONF_FORCE_DHCP: data.pop(CONF_FORCE_DHCP, False),
|
||||||
CONF_DETECTION_TIME: self.config_entry.data.pop(
|
CONF_DETECTION_TIME: data.pop(
|
||||||
CONF_DETECTION_TIME, DEFAULT_DETECTION_TIME
|
CONF_DETECTION_TIME, DEFAULT_DETECTION_TIME
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
self.hass.config_entries.async_update_entry(
|
self.hass.config_entries.async_update_entry(
|
||||||
self.config_entry, options=options
|
self.config_entry, data=data, options=options
|
||||||
)
|
)
|
||||||
|
|
||||||
async def request_update(self):
|
async def request_update(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user