mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Fix HomeWizard unclosed clientsession error when closing Home Assistant (#65296)
This commit is contained in:
parent
9294319048
commit
fd7f66fbdc
@ -8,6 +8,7 @@ import aiohwenergy
|
|||||||
import async_timeout
|
import async_timeout
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
|
|
||||||
from .const import DOMAIN, UPDATE_INTERVAL, DeviceResponseEntry
|
from .const import DOMAIN, UPDATE_INTERVAL, DeviceResponseEntry
|
||||||
@ -28,7 +29,9 @@ class HWEnergyDeviceUpdateCoordinator(DataUpdateCoordinator[DeviceResponseEntry]
|
|||||||
"""Initialize Update Coordinator."""
|
"""Initialize Update Coordinator."""
|
||||||
|
|
||||||
super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=UPDATE_INTERVAL)
|
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:
|
async def _async_update_data(self) -> DeviceResponseEntry:
|
||||||
"""Fetch all device and sensor data from api."""
|
"""Fetch all device and sensor data from api."""
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"codeowners": ["@DCSBL"],
|
"codeowners": ["@DCSBL"],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"aiohwenergy==0.7.0"
|
"aiohwenergy==0.8.0"
|
||||||
],
|
],
|
||||||
"zeroconf": ["_hwenergy._tcp.local."],
|
"zeroconf": ["_hwenergy._tcp.local."],
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
|
@ -194,7 +194,7 @@ aiohttp_cors==0.7.0
|
|||||||
aiohue==3.0.11
|
aiohue==3.0.11
|
||||||
|
|
||||||
# homeassistant.components.homewizard
|
# homeassistant.components.homewizard
|
||||||
aiohwenergy==0.7.0
|
aiohwenergy==0.8.0
|
||||||
|
|
||||||
# homeassistant.components.imap
|
# homeassistant.components.imap
|
||||||
aioimaplib==0.9.0
|
aioimaplib==0.9.0
|
||||||
|
@ -144,7 +144,7 @@ aiohttp_cors==0.7.0
|
|||||||
aiohue==3.0.11
|
aiohue==3.0.11
|
||||||
|
|
||||||
# homeassistant.components.homewizard
|
# homeassistant.components.homewizard
|
||||||
aiohwenergy==0.7.0
|
aiohwenergy==0.8.0
|
||||||
|
|
||||||
# homeassistant.components.apache_kafka
|
# homeassistant.components.apache_kafka
|
||||||
aiokafka==0.6.0
|
aiokafka==0.6.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user