Wolflink connection pooling (#111483)

* Enable connection pooling

* Decrease polling frequency

* Replace client passing by instance instead of lambda
pull/109944/head
Jan Rothkegel 2024-02-27 15:59:52 +01:00 committed by GitHub
parent 6ccf7dea32
commit 887182c224
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 5 deletions

View File

@ -10,6 +10,7 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.httpx_client import get_async_client
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import (
@ -41,7 +42,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
gateway_id,
)
wolf_client = WolfClient(username, password)
wolf_client = WolfClient(
username,
password,
client=get_async_client(hass=hass, verify_ssl=False),
)
parameters = await fetch_parameters_init(wolf_client, gateway_id, device_id)
@ -94,7 +99,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
_LOGGER,
name=DOMAIN,
update_method=async_update_data,
update_interval=timedelta(minutes=1),
update_interval=timedelta(seconds=90),
)
await coordinator.async_refresh()

View File

@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/wolflink",
"iot_class": "cloud_polling",
"loggers": ["wolf_comm"],
"requirements": ["wolf-comm==0.0.4"]
"requirements": ["wolf-comm==0.0.6"]
}

View File

@ -2860,7 +2860,7 @@ wirelesstagpy==0.8.1
wled==0.17.0
# homeassistant.components.wolflink
wolf-comm==0.0.4
wolf-comm==0.0.6
# homeassistant.components.wyoming
wyoming==1.5.3

View File

@ -2195,7 +2195,7 @@ wiffi==1.1.2
wled==0.17.0
# homeassistant.components.wolflink
wolf-comm==0.0.4
wolf-comm==0.0.6
# homeassistant.components.wyoming
wyoming==1.5.3