From 4726dc96d43dda802dd571479764fc9bf61eaf90 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 2 Oct 2024 14:19:23 +0200 Subject: [PATCH] Ensure directv config flow title_placeholders items are [str, str] (#127288) --- homeassistant/components/directv/config_flow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/directv/config_flow.py b/homeassistant/components/directv/config_flow.py index 56d8f262d1c..1e0577b4f7c 100644 --- a/homeassistant/components/directv/config_flow.py +++ b/homeassistant/components/directv/config_flow.py @@ -3,7 +3,7 @@ from __future__ import annotations import logging -from typing import Any +from typing import Any, cast from urllib.parse import urlparse from directv import DIRECTV, DIRECTVError @@ -70,7 +70,9 @@ class DirecTVConfigFlow(ConfigFlow, domain=DOMAIN): self, discovery_info: ssdp.SsdpServiceInfo ) -> ConfigFlowResult: """Handle SSDP discovery.""" - host = urlparse(discovery_info.ssdp_location).hostname + # We can cast the hostname to str because the ssdp_location is not bytes and + # not a relative url + host = cast(str, urlparse(discovery_info.ssdp_location).hostname) receiver_id = None if discovery_info.upnp.get(ssdp.ATTR_UPNP_SERIAL):