Fix blocking call in netdata (#132209)

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
pull/132245/head^2
cnico 2024-12-04 09:53:29 +01:00 committed by GitHub
parent cafd2092d4
commit 5600ad0d82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -6,5 +6,5 @@
"iot_class": "local_polling",
"loggers": ["netdata"],
"quality_scale": "legacy",
"requirements": ["netdata==1.1.0"]
"requirements": ["netdata==1.3.0"]
}

View File

@ -24,6 +24,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import PlatformNotReady
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.httpx_client import get_async_client
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
_LOGGER = logging.getLogger(__name__)
@ -70,7 +71,9 @@ async def async_setup_platform(
port = config[CONF_PORT]
resources = config[CONF_RESOURCES]
netdata = NetdataData(Netdata(host, port=port, timeout=20.0))
netdata = NetdataData(
Netdata(host, port=port, timeout=20.0, httpx_client=get_async_client(hass))
)
await netdata.async_update()
if netdata.api.metrics is None:

View File

@ -1433,7 +1433,7 @@ ndms2-client==0.1.2
nessclient==1.1.2
# homeassistant.components.netdata
netdata==1.1.0
netdata==1.3.0
# homeassistant.components.nmap_tracker
netmap==0.7.0.2