Don't cast type in HEOS services (#136583)

pull/136585/head
Andrew Sayre 2025-01-26 09:53:10 -06:00 committed by GitHub
parent a2bc260dc1
commit 6a877ec77d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,6 @@
"""Services for the HEOS integration."""
import logging
from typing import cast
from pyheos import CommandAuthenticationError, Heos, HeosError
import voluptuous as vol
@ -61,10 +60,10 @@ def _get_controller(hass: HomeAssistant) -> Heos:
translation_key="sign_in_out_deprecated",
)
entry = cast(
HeosConfigEntry,
hass.config_entries.async_entry_for_domain_unique_id(DOMAIN, DOMAIN),
entry: HeosConfigEntry | None = (
hass.config_entries.async_entry_for_domain_unique_id(DOMAIN, DOMAIN)
)
if not entry or not entry.state == ConfigEntryState.LOADED:
raise HomeAssistantError(
translation_domain=DOMAIN, translation_key="integration_not_loaded"