Fix HomeWizard unclosed clientsession error when closing Home Assistant (#65296)
parent
9294319048
commit
fd7f66fbdc
|
@ -8,6 +8,7 @@ import aiohwenergy
|
|||
import async_timeout
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
|
||||
from .const import DOMAIN, UPDATE_INTERVAL, DeviceResponseEntry
|
||||
|
@ -28,7 +29,9 @@ class HWEnergyDeviceUpdateCoordinator(DataUpdateCoordinator[DeviceResponseEntry]
|
|||
"""Initialize Update Coordinator."""
|
||||
|
||||
super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=UPDATE_INTERVAL)
|
||||
self.api = aiohwenergy.HomeWizardEnergy(host)
|
||||
|
||||
session = async_get_clientsession(hass)
|
||||
self.api = aiohwenergy.HomeWizardEnergy(host, clientsession=session)
|
||||
|
||||
async def _async_update_data(self) -> DeviceResponseEntry:
|
||||
"""Fetch all device and sensor data from api."""
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"codeowners": ["@DCSBL"],
|
||||
"dependencies": [],
|
||||
"requirements": [
|
||||
"aiohwenergy==0.7.0"
|
||||
"aiohwenergy==0.8.0"
|
||||
],
|
||||
"zeroconf": ["_hwenergy._tcp.local."],
|
||||
"config_flow": true,
|
||||
|
|
|
@ -194,7 +194,7 @@ aiohttp_cors==0.7.0
|
|||
aiohue==3.0.11
|
||||
|
||||
# homeassistant.components.homewizard
|
||||
aiohwenergy==0.7.0
|
||||
aiohwenergy==0.8.0
|
||||
|
||||
# homeassistant.components.imap
|
||||
aioimaplib==0.9.0
|
||||
|
|
|
@ -144,7 +144,7 @@ aiohttp_cors==0.7.0
|
|||
aiohue==3.0.11
|
||||
|
||||
# homeassistant.components.homewizard
|
||||
aiohwenergy==0.7.0
|
||||
aiohwenergy==0.8.0
|
||||
|
||||
# homeassistant.components.apache_kafka
|
||||
aiokafka==0.6.0
|
||||
|
|
Loading…
Reference in New Issue