mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Wolflink connection pooling (#111483)
* Enable connection pooling * Decrease polling frequency * Replace client passing by instance instead of lambda
This commit is contained in:
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.const import CONF_PASSWORD, CONF_USERNAME, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
|
from homeassistant.helpers.httpx_client import get_async_client
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
@ -41,7 +42,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
gateway_id,
|
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)
|
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,
|
_LOGGER,
|
||||||
name=DOMAIN,
|
name=DOMAIN,
|
||||||
update_method=async_update_data,
|
update_method=async_update_data,
|
||||||
update_interval=timedelta(minutes=1),
|
update_interval=timedelta(seconds=90),
|
||||||
)
|
)
|
||||||
|
|
||||||
await coordinator.async_refresh()
|
await coordinator.async_refresh()
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/wolflink",
|
"documentation": "https://www.home-assistant.io/integrations/wolflink",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["wolf_comm"],
|
"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
|
wled==0.17.0
|
||||||
|
|
||||||
# homeassistant.components.wolflink
|
# homeassistant.components.wolflink
|
||||||
wolf-comm==0.0.4
|
wolf-comm==0.0.6
|
||||||
|
|
||||||
# homeassistant.components.wyoming
|
# homeassistant.components.wyoming
|
||||||
wyoming==1.5.3
|
wyoming==1.5.3
|
||||||
|
@ -2195,7 +2195,7 @@ wiffi==1.1.2
|
|||||||
wled==0.17.0
|
wled==0.17.0
|
||||||
|
|
||||||
# homeassistant.components.wolflink
|
# homeassistant.components.wolflink
|
||||||
wolf-comm==0.0.4
|
wolf-comm==0.0.6
|
||||||
|
|
||||||
# homeassistant.components.wyoming
|
# homeassistant.components.wyoming
|
||||||
wyoming==1.5.3
|
wyoming==1.5.3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user