Reduce rainmachine intervals to avoid device overload (#58319)
This commit is contained in:
parent
f1884d34e9
commit
f619a8e4a0
4 changed files with 12 additions and 4 deletions
|
@ -55,6 +55,14 @@ CONFIG_SCHEMA = cv.deprecated(DOMAIN)
|
|||
|
||||
PLATFORMS = ["binary_sensor", "sensor", "switch"]
|
||||
|
||||
UPDATE_INTERVALS = {
|
||||
DATA_PROVISION_SETTINGS: timedelta(minutes=1),
|
||||
DATA_PROGRAMS: timedelta(seconds=30),
|
||||
DATA_RESTRICTIONS_CURRENT: timedelta(minutes=1),
|
||||
DATA_RESTRICTIONS_UNIVERSAL: timedelta(minutes=1),
|
||||
DATA_ZONES: timedelta(seconds=15),
|
||||
}
|
||||
|
||||
# Constants expected by the RainMachine API for Service Data
|
||||
CONF_CONDITION = "condition"
|
||||
CONF_DEWPOINT = "dewpoint"
|
||||
|
@ -230,7 +238,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
hass,
|
||||
LOGGER,
|
||||
name=f'{controller.name} ("{api_category}")',
|
||||
update_interval=DEFAULT_UPDATE_INTERVAL,
|
||||
update_interval=UPDATE_INTERVALS[api_category],
|
||||
update_method=partial(async_update, api_category),
|
||||
)
|
||||
controller_init_tasks.append(coordinator.async_refresh())
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "RainMachine",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/rainmachine",
|
||||
"requirements": ["regenmaschine==3.2.0"],
|
||||
"requirements": ["regenmaschine==2021.10.0"],
|
||||
"codeowners": ["@bachya"],
|
||||
"iot_class": "local_polling",
|
||||
"homekit": {
|
||||
|
|
|
@ -2040,7 +2040,7 @@ raincloudy==0.0.7
|
|||
raspyrfm-client==1.2.8
|
||||
|
||||
# homeassistant.components.rainmachine
|
||||
regenmaschine==3.2.0
|
||||
regenmaschine==2021.10.0
|
||||
|
||||
# homeassistant.components.renault
|
||||
renault-api==0.1.4
|
||||
|
|
|
@ -1190,7 +1190,7 @@ pyzerproc==0.4.8
|
|||
rachiopy==1.0.3
|
||||
|
||||
# homeassistant.components.rainmachine
|
||||
regenmaschine==3.2.0
|
||||
regenmaschine==2021.10.0
|
||||
|
||||
# homeassistant.components.renault
|
||||
renault-api==0.1.4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue