From e7695fbf5df061da8e32692716554f352eb20438 Mon Sep 17 00:00:00 2001 From: Fabian Seitz Date: Thu, 6 Jun 2024 09:57:46 +0200 Subject: [PATCH] Update deprecated HomeAssistantType #35 --- custom_components/deutschebahn/manifest.json | 2 +- custom_components/deutschebahn/sensor.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/deutschebahn/manifest.json b/custom_components/deutschebahn/manifest.json index 6eae98f..3cddf8a 100644 --- a/custom_components/deutschebahn/manifest.json +++ b/custom_components/deutschebahn/manifest.json @@ -14,5 +14,5 @@ "requirements": [ "schiene==0.26" ], - "version": "2.2.1" + "version": "2.2.2" } \ No newline at end of file diff --git a/custom_components/deutschebahn/sensor.py b/custom_components/deutschebahn/sensor.py index 645074d..088a1ee 100644 --- a/custom_components/deutschebahn/sensor.py +++ b/custom_components/deutschebahn/sensor.py @@ -14,9 +14,9 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.typing import ( ConfigType, - HomeAssistantType, DiscoveryInfoType, ) +from homeassistant.core import HomeAssistant import homeassistant.util.dt as dt_util import voluptuous as vol @@ -36,7 +36,7 @@ SCAN_INTERVAL = timedelta(minutes=2) async def async_setup_entry( - hass: HomeAssistantType, entry: ConfigType, async_add_entities + hass: HomeAssistant, entry: ConfigType, async_add_entities ): """Setup sensors from a config entry created in the integrations UI.""" config = hass.data[DOMAIN][entry.entry_id] @@ -54,7 +54,7 @@ async def async_setup_entry( class DeutscheBahnSensor(SensorEntity): """Implementation of a Deutsche Bahn sensor.""" - def __init__(self, config, hass: HomeAssistantType): + def __init__(self, config, hass: HomeAssistant): super().__init__() self._name = f"{config[CONF_START]} to {config[CONF_DESTINATION]}" self._state = None