Wolflink connection pooling (#111483)
* Enable connection pooling * Decrease polling frequency * Replace client passing by instance instead of lambdapull/109944/head
parent
6ccf7dea32
commit
887182c224
|
@ -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()
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue