Skip to content

Commit

Permalink
Updating depreacted homeassistant.helpers.typing references (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
barndawgie authored Jun 22, 2024
1 parent b8e041d commit 3d64a9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions custom_components/kumo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.core import HomeAssistant
from homeassistant.util.json import load_json, save_json

from .coordinator import KumoDataUpdateCoordinator
Expand Down Expand Up @@ -67,7 +67,7 @@ def get_raw_json(self):
"""Retrieve raw JSON config from account."""
return self._account.get_raw_json()

async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Setup Kumo Entry"""
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN].setdefault(entry.entry_id, {})
Expand Down Expand Up @@ -107,7 +107,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
_LOGGER.warning("Could not load config from KumoCloud server or cache")
return False

async def async_kumo_setup(hass: HomeAssistantType, prefer_cache: bool, username: str, password: str) -> Optional[pykumo.KumoCloudAccount]:
async def async_kumo_setup(hass: HomeAssistant, prefer_cache: bool, username: str, password: str) -> Optional[pykumo.KumoCloudAccount]:
"""Attempt to load data from cache or Kumo Cloud"""
if prefer_cache:
cached_json = await hass.async_add_executor_job(
Expand All @@ -130,7 +130,7 @@ async def async_kumo_setup(hass: HomeAssistantType, prefer_cache: bool, username

return account

async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry):
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Unload Entry"""

for platform in PLATFORMS:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/kumo/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_TEMPERATURE, UnitOfTemperature
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.core import HomeAssistant

from .const import KUMO_DATA, KUMO_DATA_COORDINATORS

Expand Down Expand Up @@ -90,7 +90,7 @@


async def async_setup_entry(
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
hass: HomeAssistant, entry: ConfigEntry, async_add_entities
):
"""Set up the Kumo thermostats."""
account = hass.data[DOMAIN][entry.entry_id][KUMO_DATA].get_account()
Expand Down
4 changes: 2 additions & 2 deletions custom_components/kumo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import SIGNAL_STRENGTH_DECIBELS, UnitOfTemperature, PERCENTAGE, PRECISION_TENTHS
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.core import HomeAssistant

from . import KUMO_DATA

Expand All @@ -35,7 +35,7 @@
}
)

async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry, async_add_entities):
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_entities):
"""Set up the Kumo thermostats."""
account = hass.data[DOMAIN][entry.entry_id][KUMO_DATA].get_account()
coordinators = hass.data[DOMAIN][entry.entry_id][KUMO_DATA_COORDINATORS]
Expand Down

0 comments on commit 3d64a9d

Please sign in to comment.