From 97bbad7471f2e270a3ec72cb67078f87eb17ae1d Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 1 Oct 2024 14:40:12 +0200 Subject: [PATCH] Ensure ezviz config flow title_placeholders items are [str, str] (#127194) --- homeassistant/components/ezviz/config_flow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/ezviz/config_flow.py b/homeassistant/components/ezviz/config_flow.py index f9d184f39b0..ec65de2f210 100644 --- a/homeassistant/components/ezviz/config_flow.py +++ b/homeassistant/components/ezviz/config_flow.py @@ -4,7 +4,7 @@ from __future__ import annotations from collections.abc import Mapping import logging -from typing import Any +from typing import TYPE_CHECKING, Any from pyezviz.client import EzvizClient from pyezviz.exceptions import ( @@ -274,6 +274,9 @@ class EzvizConfigFlow(ConfigFlow, domain=DOMAIN): await self.async_set_unique_id(discovery_info[ATTR_SERIAL]) self._abort_if_unique_id_configured() + if TYPE_CHECKING: + # A unique ID is passed in via the discovery info + assert self.unique_id is not None self.context["title_placeholders"] = {ATTR_SERIAL: self.unique_id} self.ip_address = discovery_info[CONF_IP_ADDRESS]