Bump Weheat to 2025.1.15 (#135626)

This commit is contained in:
jesperraemaekers 2025-01-17 17:43:15 +01:00 committed by GitHub
parent 24bb623567
commit 44b577cadb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 15 additions and 11 deletions

View File

@ -12,6 +12,7 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_ACCESS_TOKEN, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.config_entry_oauth2_flow import (
OAuth2Session,
async_get_config_entry_implementation,
@ -49,7 +50,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: WeheatConfigEntry) -> bo
# fetch a list of the heat pumps the entry can access
try:
discovered_heat_pumps = await HeatPumpDiscovery.async_discover_active(
API_URL, token
API_URL, token, async_get_clientsession(hass)
)
except UnauthorizedException as error:
raise ConfigEntryAuthFailed from error

View File

@ -8,6 +8,7 @@ from weheat.abstractions.user import async_get_user_id_from_token
from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlowResult
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.config_entry_oauth2_flow import AbstractOAuth2FlowHandler
from .const import API_URL, DOMAIN, ENTRY_TITLE, OAUTH2_SCOPES
@ -34,7 +35,9 @@ class OAuth2FlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
"""Override the create entry method to change to the step to find the heat pumps."""
# get the user id and use that as unique id for this entry
user_id = await async_get_user_id_from_token(
API_URL, data[CONF_TOKEN][CONF_ACCESS_TOKEN]
API_URL,
data[CONF_TOKEN][CONF_ACCESS_TOKEN],
async_get_clientsession(self.hass),
)
await self.async_set_unique_id(user_id)
if self.source != SOURCE_REAUTH:

View File

@ -16,6 +16,7 @@ from weheat.exceptions import (
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.config_entry_oauth2_flow import OAuth2Session
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
@ -47,7 +48,9 @@ class WeheatDataUpdateCoordinator(DataUpdateCoordinator[HeatPump]):
update_interval=timedelta(seconds=UPDATE_INTERVAL),
)
self.heat_pump_info = heat_pump
self._heat_pump_data = HeatPump(API_URL, heat_pump.uuid)
self._heat_pump_data = HeatPump(
API_URL, heat_pump.uuid, async_get_clientsession(hass)
)
self.session = session

View File

@ -6,5 +6,5 @@
"dependencies": ["application_credentials"],
"documentation": "https://www.home-assistant.io/integrations/weheat",
"iot_class": "cloud_polling",
"requirements": ["weheat==2025.1.14"]
"requirements": ["weheat==2025.1.15"]
}

View File

@ -88,9 +88,6 @@ rules:
While unlikely to happen. Check if it is easily integrated.
# Platinum
async-dependency:
status: todo
comment: |
Dependency uses asyncio.to_thread, but this is not real async.
inject-websession: todo
async-dependency: done
inject-websession: done
strict-typing: todo

2
requirements_all.txt generated
View File

@ -3033,7 +3033,7 @@ webio-api==0.1.11
webmin-xmlrpc==0.0.2
# homeassistant.components.weheat
weheat==2025.1.14
weheat==2025.1.15
# homeassistant.components.whirlpool
whirlpool-sixth-sense==0.18.11

View File

@ -2437,7 +2437,7 @@ webio-api==0.1.11
webmin-xmlrpc==0.0.2
# homeassistant.components.weheat
weheat==2025.1.14
weheat==2025.1.15
# homeassistant.components.whirlpool
whirlpool-sixth-sense==0.18.11