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

This commit is contained in:
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

View File

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