mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Store huawei_lte flow data in flow handler attributes (#127173)
This commit is contained in:
parent
f0b57e2873
commit
b12f3e5aff
@ -60,6 +60,9 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
VERSION = 3
|
VERSION = 3
|
||||||
|
|
||||||
|
manufacturer: str | None = None
|
||||||
|
url: str | None = None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(
|
def async_get_options_flow(
|
||||||
@ -81,10 +84,7 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
{
|
{
|
||||||
vol.Required(
|
vol.Required(
|
||||||
CONF_URL,
|
CONF_URL,
|
||||||
default=user_input.get(
|
default=user_input.get(CONF_URL, self.url or ""),
|
||||||
CONF_URL,
|
|
||||||
self.context.get(CONF_URL, ""),
|
|
||||||
),
|
|
||||||
): str,
|
): str,
|
||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_VERIFY_SSL,
|
CONF_VERIFY_SSL,
|
||||||
@ -241,7 +241,7 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
user_input.update(
|
user_input.update(
|
||||||
{
|
{
|
||||||
CONF_MAC: get_device_macs(info, wlan_settings),
|
CONF_MAC: get_device_macs(info, wlan_settings),
|
||||||
CONF_MANUFACTURER: self.context.get(CONF_MANUFACTURER),
|
CONF_MANUFACTURER: self.manufacturer,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -302,11 +302,12 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
{
|
{
|
||||||
"title_placeholders": {
|
"title_placeholders": {
|
||||||
CONF_NAME: discovery_info.upnp.get(ssdp.ATTR_UPNP_FRIENDLY_NAME)
|
CONF_NAME: discovery_info.upnp.get(ssdp.ATTR_UPNP_FRIENDLY_NAME)
|
||||||
},
|
or "Huawei LTE"
|
||||||
CONF_MANUFACTURER: discovery_info.upnp.get(ssdp.ATTR_UPNP_MANUFACTURER),
|
}
|
||||||
CONF_URL: url,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
self.manufacturer = discovery_info.upnp.get(ssdp.ATTR_UPNP_MANUFACTURER)
|
||||||
|
self.url = url
|
||||||
return await self._async_show_user_form()
|
return await self._async_show_user_form()
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user