Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blocking call in netdata #132209

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/netdata/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"iot_class": "local_polling",
"loggers": ["netdata"],
"quality_scale": "legacy",
"requirements": ["netdata==1.1.0"]
"requirements": ["netdata==1.3.0"]
}
5 changes: 4 additions & 1 deletion homeassistant/components/netdata/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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

Check warning on line 27 in homeassistant/components/netdata/sensor.py

View check run for this annotation

Codecov / codecov/patch

homeassistant/components/netdata/sensor.py#L27

Added line #L27 was not covered by tests
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -70,7 +71,9 @@
port = config[CONF_PORT]
resources = config[CONF_RESOURCES]

netdata = NetdataData(Netdata(host, port=port, timeout=20.0))
netdata = NetdataData(

Check warning on line 74 in homeassistant/components/netdata/sensor.py

View check run for this annotation

Codecov / codecov/patch

homeassistant/components/netdata/sensor.py#L74

Added line #L74 was not covered by tests
Netdata(host, port=port, timeout=20.0, httpx_client=get_async_client(hass))
)
await netdata.async_update()

if netdata.api.metrics is None:
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down