Skip to content

Commit ad31141

Browse files
authored
Merge pull request #136 from PimDoos/dev
Increase coordinator timeout to 10 seconds
2 parents f59cc87 + aee02d0 commit ad31141

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

custom_components/sessy/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
ENTITY_ERROR_THRESHOLD = 5
3030
COORDINATOR_RETRIES = 5
3131
COORDINATOR_RETRY_DELAY = 1
32+
COORDINATOR_TIMEOUT = 10
3233

3334
SESSY_RELEASE_NOTES_URL = "https://www.sessy.nl/firmware-updates"

custom_components/sessy/coordinator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from sessypy.devices import SessyBattery, SessyCTMeter, SessyDevice, SessyMeter, SessyP1Meter
1919
from sessypy.util import SessyException, SessyLoginException
2020

21-
from .const import COORDINATOR_RETRIES, COORDINATOR_RETRY_DELAY, DEFAULT_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL_POWER, ENTITY_ERROR_THRESHOLD, SCAN_INTERVAL_OTA_CHECK, SCAN_INTERVAL_SCHEDULE
21+
from .const import COORDINATOR_RETRIES, COORDINATOR_RETRY_DELAY, COORDINATOR_TIMEOUT, DEFAULT_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL_POWER, ENTITY_ERROR_THRESHOLD, SCAN_INTERVAL_OTA_CHECK, SCAN_INTERVAL_SCHEDULE
2222
from .models import SessyConfigEntry
2323
from .util import get_nested_key
2424

@@ -143,7 +143,7 @@ async def _async_update_data(self):
143143
try:
144144
# Note: asyncio.TimeoutError and aiohttp.ClientError are already
145145
# handled by the data update coordinator.
146-
async with async_timeout.timeout(self.update_interval.seconds / 2):
146+
async with async_timeout.timeout(COORDINATOR_TIMEOUT):
147147
data = await self._device_function()
148148

149149
contexts: list[SessyEntityContext] = set(self.async_contexts())

custom_components/sessy/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"issue_tracker": "https://github.com/PimDoos/ha-sessy/issues",
1313
"loggers": ["sessypy"],
1414
"requirements": ["sessypy==0.2.1"],
15-
"version": "0.8.5",
15+
"version": "0.8.6",
1616
"zeroconf":[
1717
{"type":"_http._tcp.local.","name":"sessy-*"}
1818
]

0 commit comments

Comments
 (0)