Address late review of Adax (#61200)
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>pull/61241/head
parent
d5aa4a9ce1
commit
9a46e802b7
|
@ -75,12 +75,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
configurator = adax_local.AdaxConfig(wifi_ssid, wifi_pswd)
|
||||
|
||||
try:
|
||||
if not await configurator.configure_device():
|
||||
return self.async_show_form(
|
||||
step_id="local",
|
||||
data_schema=data_schema,
|
||||
errors={"base": "cannot_connect"},
|
||||
)
|
||||
device_configured = await configurator.configure_device()
|
||||
except adax_local.HeaterNotAvailable:
|
||||
return self.async_abort(reason="heater_not_available")
|
||||
except adax_local.HeaterNotFound:
|
||||
|
@ -88,6 +83,13 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
except adax_local.InvalidWifiCred:
|
||||
return self.async_abort(reason="invalid_auth")
|
||||
|
||||
if not device_configured:
|
||||
return self.async_show_form(
|
||||
step_id="local",
|
||||
data_schema=data_schema,
|
||||
errors={"base": "cannot_connect"},
|
||||
)
|
||||
|
||||
unique_id = configurator.mac_id
|
||||
await self.async_set_unique_id(unique_id)
|
||||
self._abort_if_unique_id_configured()
|
||||
|
|
Loading…
Reference in New Issue