Refactoring upnp component (#43646)
This commit is contained in:
parent
f080af698d
commit
25c5c6aec9
8 changed files with 284 additions and 207 deletions
|
@ -83,13 +83,7 @@ async def async_setup_entry(
|
|||
hass, config_entry: ConfigEntry, async_add_entities
|
||||
) -> None:
|
||||
"""Set up the UPnP/IGD sensors."""
|
||||
data = config_entry.data
|
||||
if CONFIG_ENTRY_UDN in data:
|
||||
udn = data[CONFIG_ENTRY_UDN]
|
||||
else:
|
||||
# any device will do
|
||||
udn = list(hass.data[DOMAIN][DOMAIN_DEVICES])[0]
|
||||
|
||||
udn = config_entry.data[CONFIG_ENTRY_UDN]
|
||||
device: Device = hass.data[DOMAIN][DOMAIN_DEVICES][udn]
|
||||
|
||||
update_interval_sec = config_entry.options.get(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue