Increase polling interval to prevent reaching daily limit ()

* increase polling interval to prevent reaching daily limit

* update test accordingly
pull/53080/head
Vincent Le Bourlot 2021-07-15 23:24:54 +02:00 committed by GitHub
parent 989839a1a9
commit cf647c5d20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions
homeassistant/components/home_plus_control
tests/components/home_plus_control

View File

@ -133,7 +133,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
name="home_plus_control_module",
update_method=async_update_data,
# Polling interval. Will only be polled if there are subscribers.
update_interval=timedelta(seconds=60),
update_interval=timedelta(seconds=300),
)
hass_entry_data[DATA_COORDINATOR] = coordinator

View File

@ -146,7 +146,7 @@ async def test_plant_topology_reduction_change(
return_value=mock_modules,
) as mock_check:
async_fire_time_changed(
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=100)
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=400)
)
await hass.async_block_till_done()
assert len(mock_check.mock_calls) == 1
@ -208,7 +208,7 @@ async def test_plant_topology_increase_change(
return_value=mock_modules,
) as mock_check:
async_fire_time_changed(
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=100)
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=400)
)
await hass.async_block_till_done()
assert len(mock_check.mock_calls) == 1
@ -268,7 +268,7 @@ async def test_module_status_unavailable(hass, mock_config_entry, mock_modules):
return_value=mock_modules,
) as mock_check:
async_fire_time_changed(
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=100)
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=400)
)
await hass.async_block_till_done()
assert len(mock_check.mock_calls) == 1
@ -339,7 +339,7 @@ async def test_module_status_available(
return_value=mock_modules,
) as mock_check:
async_fire_time_changed(
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=100)
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=400)
)
await hass.async_block_till_done()
assert len(mock_check.mock_calls) == 1
@ -443,7 +443,7 @@ async def test_update_with_api_error(
side_effect=HomePlusControlApiError,
) as mock_check:
async_fire_time_changed(
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=100)
hass, dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=400)
)
await hass.async_block_till_done()
assert len(mock_check.mock_calls) == 1