Remove user-configurable polling interval from risco (#184386)

This commit is contained in:
Manu
2026-10-06 09:41:38 +02:00
committed by GitHub
parent ecd2fb85bc
commit 6b8d68192a
5 changed files with 4 additions and 22 deletions
@@ -14,7 +14,6 @@ from homeassistant.const import (
CONF_PASSWORD,
CONF_PIN,
CONF_PORT,
CONF_SCAN_INTERVAL,
CONF_TYPE,
CONF_USERNAME,
)
@@ -234,13 +233,6 @@ class RiscoOptionsFlowHandler(OptionsFlow):
probatio.Required(CONF_MORE_OPTIONS): section(
probatio.Schema(
{
# Polling interval is user-configurable,
# which is no longer allowed
# pylint: disable-next=home-assistant-config-flow-polling-field
probatio.Required(
CONF_SCAN_INTERVAL,
default=self._data[CONF_SCAN_INTERVAL],
): int,
probatio.Required(
CONF_CONCURRENCY,
default=self._data[CONF_CONCURRENCY],
+1 -3
View File
@@ -1,7 +1,6 @@
"""Constants for the Risco integration."""
from homeassistant.components.alarm_control_panel import AlarmControlPanelState
from homeassistant.const import CONF_SCAN_INTERVAL
DOMAIN = "risco"
@@ -10,7 +9,7 @@ RISCO_EVENT = "risco_event"
DATA_COORDINATOR = "risco"
EVENTS_COORDINATOR = "risco_events"
DEFAULT_SCAN_INTERVAL = 30
SCAN_INTERVAL = 30
DEFAULT_CONCURRENCY = 4
TYPE_LOCAL = "local"
@@ -53,7 +52,6 @@ DEFAULT_OPTIONS = {
}
DEFAULT_ADVANCED_OPTIONS = {
CONF_SCAN_INTERVAL: DEFAULT_SCAN_INTERVAL,
CONF_CONCURRENCY: DEFAULT_CONCURRENCY,
}
@@ -9,12 +9,11 @@ from pyrisco.cloud.alarm import Alarm
from pyrisco.cloud.event import Event
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_SCAN_INTERVAL
from homeassistant.core import HomeAssistant
from homeassistant.helpers.storage import Store
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import DEFAULT_SCAN_INTERVAL, DOMAIN
from .const import DOMAIN, SCAN_INTERVAL
LAST_EVENT_STORAGE_VERSION = 1
LAST_EVENT_TIMESTAMP_KEY = "last_event_timestamp"
@@ -39,11 +38,7 @@ class RiscoDataUpdateCoordinator(DataUpdateCoordinator[Alarm]):
_LOGGER,
config_entry=config_entry,
name=DOMAIN,
update_interval=timedelta(
seconds=config_entry.options.get(
CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL
)
),
update_interval=timedelta(seconds=SCAN_INTERVAL),
)
@override
+1 -2
View File
@@ -96,8 +96,7 @@
"sections": {
"more_options": {
"data": {
"concurrency": "Maximum concurrent requests in Risco local",
"scan_interval": "How often to poll Risco Cloud (in seconds)"
"concurrency": "Maximum concurrent requests in Risco local"
},
"name": "More options"
}
@@ -55,7 +55,6 @@ TEST_OPTIONS = {
}
TEST_ADVANCED_OPTIONS = {
"scan_interval": 10,
"concurrency": 3,
}
@@ -384,7 +383,6 @@ async def test_options_flow(hass: HomeAssistant) -> None:
assert result["type"] is FlowResultType.CREATE_ENTRY
assert entry.options == {
**TEST_OPTIONS,
"scan_interval": 30,
"concurrency": 4,
"risco_states_to_ha": TEST_RISCO_TO_HA,
"ha_states_to_risco": TEST_HA_TO_RISCO,