Skip to content

Commit

Permalink
Use PEP 695 type alias for ConfigEntry types (#117632)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored May 17, 2024
1 parent 0b8a5ac commit 44049c3
Show file tree
Hide file tree
Showing 74 changed files with 78 additions and 77 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/accuweather/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AccuWeatherData:
coordinator_daily_forecast: AccuWeatherDailyForecastDataUpdateCoordinator


AccuWeatherConfigEntry = ConfigEntry[AccuWeatherData]
type AccuWeatherConfigEntry = ConfigEntry[AccuWeatherData]


async def async_setup_entry(hass: HomeAssistant, entry: AccuWeatherConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/acmeda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

PLATFORMS = [Platform.COVER, Platform.SENSOR]

AcmedaConfigEntry = ConfigEntry[PulseHub]
type AcmedaConfigEntry = ConfigEntry[PulseHub]


async def async_setup_entry(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/adguard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
)

PLATFORMS = [Platform.SENSOR, Platform.SWITCH]
AdGuardConfigEntry = ConfigEntry["AdGuardData"]
type AdGuardConfigEntry = ConfigEntry[AdGuardData]


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/advantage_air/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .const import ADVANTAGE_AIR_RETRY
from .models import AdvantageAirData

AdvantageAirDataConfigEntry = ConfigEntry[AdvantageAirData]
type AdvantageAirDataConfigEntry = ConfigEntry[AdvantageAirData]

ADVANTAGE_AIR_SYNC_INTERVAL = 15
PLATFORMS = [
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aemet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

_LOGGER = logging.getLogger(__name__)

AemetConfigEntry = ConfigEntry["AemetData"]
type AemetConfigEntry = ConfigEntry[AemetData]


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aftership/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

PLATFORMS: list[Platform] = [Platform.SENSOR]

AfterShipConfigEntry = ConfigEntry[AfterShip]
type AfterShipConfigEntry = ConfigEntry[AfterShip]


async def async_setup_entry(hass: HomeAssistant, entry: AfterShipConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

_LOGGER = logging.getLogger(__name__)

AirlyConfigEntry = ConfigEntry[AirlyDataUpdateCoordinator]
type AirlyConfigEntry = ConfigEntry[AirlyDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: AirlyConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airnow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
_LOGGER = logging.getLogger(__name__)
PLATFORMS = [Platform.SENSOR]

AirNowConfigEntry = ConfigEntry[AirNowDataUpdateCoordinator]
type AirNowConfigEntry = ConfigEntry[AirNowDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: AirNowConfigEntry) -> bool:
Expand Down
5 changes: 2 additions & 3 deletions homeassistant/components/airthings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
PLATFORMS: list[Platform] = [Platform.SENSOR]
SCAN_INTERVAL = timedelta(minutes=6)

AirthingsDataCoordinatorType = DataUpdateCoordinator[dict[str, AirthingsDevice]]

AirthingsConfigEntry = ConfigEntry[AirthingsDataCoordinatorType]
type AirthingsDataCoordinatorType = DataUpdateCoordinator[dict[str, AirthingsDevice]]
type AirthingsConfigEntry = ConfigEntry[AirthingsDataCoordinatorType]


async def async_setup_entry(hass: HomeAssistant, entry: AirthingsConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airtouch5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

PLATFORMS: list[Platform] = [Platform.CLIMATE]

Airtouch5ConfigEntry = ConfigEntry[Airtouch5SimpleClient]
type Airtouch5ConfigEntry = ConfigEntry[Airtouch5SimpleClient]


async def async_setup_entry(hass: HomeAssistant, entry: Airtouch5ConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airvisual_pro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

UPDATE_INTERVAL = timedelta(minutes=1)

AirVisualProConfigEntry = ConfigEntry["AirVisualProData"]
type AirVisualProConfigEntry = ConfigEntry[AirVisualProData]


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/ambient_station/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False)

AmbientStationConfigEntry = ConfigEntry["AmbientStation"]
type AmbientStationConfigEntry = ConfigEntry[AmbientStation]


@callback
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/analytics_insights/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .coordinator import HomeassistantAnalyticsDataUpdateCoordinator

PLATFORMS: list[Platform] = [Platform.SENSOR]
AnalyticsInsightsConfigEntry = ConfigEntry["AnalyticsInsightsData"]
type AnalyticsInsightsConfigEntry = ConfigEntry[AnalyticsInsightsData]


@dataclass(frozen=True)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/apple_tv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
exceptions.DeviceIdMissingError,
)

AppleTvConfigEntry = ConfigEntry["AppleTVManager"]
type AppleTvConfigEntry = ConfigEntry[AppleTVManager]


async def async_setup_entry(hass: HomeAssistant, entry: AppleTvConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/apsystems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

PLATFORMS: list[Platform] = [Platform.SENSOR]

ApsystemsConfigEntry = ConfigEntry[ApSystemsDataCoordinator]
type ApsystemsConfigEntry = ConfigEntry[ApSystemsDataCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: ApsystemsConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/asuswrt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

PLATFORMS = [Platform.DEVICE_TRACKER, Platform.SENSOR]

AsusWrtConfigEntry = ConfigEntry[AsusWrtRouter]
type AsusWrtConfigEntry = ConfigEntry[AsusWrtRouter]


async def async_setup_entry(hass: HomeAssistant, entry: AsusWrtConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/august/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
YALEXS_BLE_DOMAIN = "yalexs_ble"

AugustConfigEntry = ConfigEntry["AugustData"]
type AugustConfigEntry = ConfigEntry[AugustData]


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aurora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR]

AuroraConfigEntry = ConfigEntry[AuroraDataUpdateCoordinator]
type AuroraConfigEntry = ConfigEntry[AuroraDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: AuroraConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/axis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

_LOGGER = logging.getLogger(__name__)

AxisConfigEntry = ConfigEntry[AxisHub]
type AxisConfigEntry = ConfigEntry[AxisHub]


async def async_setup_entry(hass: HomeAssistant, config_entry: AxisConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/baf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from .const import QUERY_INTERVAL, RUN_TIMEOUT

BAFConfigEntry = ConfigEntry[Device]
type BAFConfigEntry = ConfigEntry[Device]


PLATFORMS: list[Platform] = [
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bond/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

_LOGGER = logging.getLogger(__name__)

BondConfigEntry = ConfigEntry[BondData]
type BondConfigEntry = ConfigEntry[BondData]


async def async_setup_entry(hass: HomeAssistant, entry: BondConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

_LOGGER = logging.getLogger(__name__)

BringConfigEntry = ConfigEntry[BringDataUpdateCoordinator]
type BringConfigEntry = ConfigEntry[BringDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: BringConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/brother/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

PLATFORMS = [Platform.SENSOR]

BrotherConfigEntry = ConfigEntry[BrotherDataUpdateCoordinator]
type BrotherConfigEntry = ConfigEntry[BrotherDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: BrotherConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/cert_expiry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

PLATFORMS = [Platform.SENSOR]

CertExpiryConfigEntry = ConfigEntry[CertExpiryDataUpdateCoordinator]
type CertExpiryConfigEntry = ConfigEntry[CertExpiryDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: CertExpiryConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/co2signal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

PLATFORMS = [Platform.SENSOR]

CO2SignalConfigEntry = ConfigEntry[CO2SignalCoordinator]
type CO2SignalConfigEntry = ConfigEntry[CO2SignalCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: CO2SignalConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/devolo_home_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from .const import CONF_MYDEVOLO, DEFAULT_MYDEVOLO, GATEWAY_SERIAL_PATTERN, PLATFORMS

DevoloHomeControlConfigEntry = ConfigEntry[list[HomeControl]]
type DevoloHomeControlConfigEntry = ConfigEntry[list[HomeControl]]


async def async_setup_entry(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/devolo_home_network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

_LOGGER = logging.getLogger(__name__)

DevoloHomeNetworkConfigEntry = ConfigEntry["DevoloHomeNetworkData"]
type DevoloHomeNetworkConfigEntry = ConfigEntry[DevoloHomeNetworkData]


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/discovergy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

PLATFORMS = [Platform.SENSOR]

DiscovergyConfigEntry = ConfigEntry[list[DiscovergyUpdateCoordinator]]
type DiscovergyConfigEntry = ConfigEntry[list[DiscovergyUpdateCoordinator]]


async def async_setup_entry(hass: HomeAssistant, entry: DiscovergyConfigEntry) -> bool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .exceptions import EntityNotFoundError
from .util import get_position_data

DwdWeatherWarningsConfigEntry = ConfigEntry["DwdWeatherWarningsCoordinator"]
type DwdWeatherWarningsConfigEntry = ConfigEntry[DwdWeatherWarningsCoordinator]


class DwdWeatherWarningsCoordinator(DataUpdateCoordinator[None]):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/ecovacs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
Platform.SWITCH,
Platform.VACUUM,
]
EcovacsConfigEntry = ConfigEntry[EcovacsController]
type EcovacsConfigEntry = ConfigEntry[EcovacsController]


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/elgato/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

PLATFORMS = [Platform.BUTTON, Platform.LIGHT, Platform.SENSOR, Platform.SWITCH]

ElgatorConfigEntry = ConfigEntry[ElgatoDataUpdateCoordinator]
type ElgatorConfigEntry = ConfigEntry[ElgatoDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: ElgatorConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/elkm1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
)
from .models import ELKM1Data

ElkM1ConfigEntry = ConfigEntry[ELKM1Data]
type ElkM1ConfigEntry = ConfigEntry[ELKM1Data]

SYNC_TIMEOUT = 120

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/filesize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .const import PLATFORMS
from .coordinator import FileSizeCoordinator

FileSizeConfigEntry = ConfigEntry[FileSizeCoordinator]
type FileSizeConfigEntry = ConfigEntry[FileSizeCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: FileSizeConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/fritzbox/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from .const import DOMAIN, LOGGER

FritzboxConfigEntry = ConfigEntry["FritzboxDataUpdateCoordinator"]
type FritzboxConfigEntry = ConfigEntry[FritzboxDataUpdateCoordinator]


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/fritzbox_callmonitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

_LOGGER = logging.getLogger(__name__)

FritzBoxCallMonitorConfigEntry = ConfigEntry[FritzBoxPhonebook]
type FritzBoxCallMonitorConfigEntry = ConfigEntry[FritzBoxPhonebook]


async def async_setup_entry(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/fronius/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

_FroniusCoordinatorT = TypeVar("_FroniusCoordinatorT", bound=FroniusCoordinatorBase)

FroniusConfigEntry = ConfigEntry["FroniusSolarNet"]
type FroniusConfigEntry = ConfigEntry[FroniusSolarNet]


async def async_setup_entry(hass: HomeAssistant, entry: FroniusConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/gios/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

PLATFORMS = [Platform.SENSOR]

GiosConfigEntry = ConfigEntry["GiosData"]
type GiosConfigEntry = ConfigEntry[GiosData]


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/habitica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

_LOGGER = logging.getLogger(__name__)

HabiticaConfigEntry = ConfigEntry[HabiticaDataUpdateCoordinator]
type HabiticaConfigEntry = ConfigEntry[HabiticaDataUpdateCoordinator]

SENSORS_TYPES = ["name", "hp", "maxHealth", "mp", "maxMP", "exp", "toNextLevel", "lvl"]

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/imgw_pib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

_LOGGER = logging.getLogger(__name__)

ImgwPibConfigEntry = ConfigEntry["ImgwPibData"]
type ImgwPibConfigEntry = ConfigEntry[ImgwPibData]


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/ipp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

PLATFORMS = [Platform.SENSOR]

IPPConfigEntry = ConfigEntry[IPPDataUpdateCoordinator]
type IPPConfigEntry = ConfigEntry[IPPDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: IPPConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/local_todo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

STORAGE_PATH = ".storage/local_todo.{key}.ics"

LocalTodoConfigEntry = ConfigEntry[LocalTodoListStore]
type LocalTodoConfigEntry = ConfigEntry[LocalTodoListStore]


async def async_setup_entry(hass: HomeAssistant, entry: LocalTodoConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/met/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

_LOGGER = logging.getLogger(__name__)

MetWeatherConfigEntry = ConfigEntry[MetDataUpdateCoordinator]
type MetWeatherConfigEntry = ConfigEntry[MetDataUpdateCoordinator]


async def async_setup_entry(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/nam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

PLATFORMS = [Platform.BUTTON, Platform.SENSOR]

NAMConfigEntry = ConfigEntry[NAMDataUpdateCoordinator]
type NAMConfigEntry = ConfigEntry[NAMDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: NAMConfigEntry) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/nextcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

_LOGGER = logging.getLogger(__name__)

NextcloudConfigEntry = ConfigEntry[NextcloudDataUpdateCoordinator]
type NextcloudConfigEntry = ConfigEntry[NextcloudDataUpdateCoordinator]


async def async_setup_entry(hass: HomeAssistant, entry: NextcloudConfigEntry) -> bool:
Expand Down
Loading

0 comments on commit 44049c3

Please sign in to comment.