mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Use scan_interval in netdata
(#80959)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
33ef2abf9e
commit
c4f6b8a55b
@ -1,7 +1,6 @@
|
|||||||
"""Support gathering system information of hosts which are running netdata."""
|
"""Support gathering system information of hosts which are running netdata."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from datetime import timedelta
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from netdata import Netdata
|
from netdata import Netdata
|
||||||
@ -22,12 +21,9 @@ from homeassistant.exceptions import PlatformNotReady
|
|||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
from homeassistant.util import Throttle
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=1)
|
|
||||||
|
|
||||||
CONF_DATA_GROUP = "data_group"
|
CONF_DATA_GROUP = "data_group"
|
||||||
CONF_ELEMENT = "element"
|
CONF_ELEMENT = "element"
|
||||||
CONF_INVERT = "invert"
|
CONF_INVERT = "invert"
|
||||||
@ -223,7 +219,6 @@ class NetdataData:
|
|||||||
self.api = api
|
self.api = api
|
||||||
self.available = True
|
self.available = True
|
||||||
|
|
||||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
|
||||||
async def async_update(self):
|
async def async_update(self):
|
||||||
"""Get the latest data from the Netdata REST API."""
|
"""Get the latest data from the Netdata REST API."""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user