Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle missing or incorrect device name and unique id for ESPHome during manual add #95678

Merged
merged 11 commits into from
Jul 2, 2023
Prev Previous commit
Next Next commit
tweak
  • Loading branch information
bdraco committed Jul 1, 2023
commit 44c8dc57a48e036649881d2f784c0193b245e15b
6 changes: 4 additions & 2 deletions homeassistant/components/esphome/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ async def _async_try_fetch_device_info(self) -> FlowResult:
error = await self.fetch_device_info()
self._noise_psk = None

await self._retrieve_encryption_key_from_dashboard()
error = await self.fetch_device_info()
if self._device_name:
await self._retrieve_encryption_key_from_dashboard()
error = await self.fetch_device_info()

# If the fetched key is invalid, unset it again.
if error == ERROR_INVALID_ENCRYPTION_KEY:
self._noise_psk = None
Expand Down