Skip to content

fix: use seconds value for retry_after#163

Merged
iprak merged 1 commit intomainfrom
fix_data_update_retry
Apr 19, 2026
Merged

fix: use seconds value for retry_after#163
iprak merged 1 commit intomainfrom
fix_data_update_retry

Conversation

@iprak
Copy link
Copy Markdown
Owner

@iprak iprak commented Apr 19, 2026

The value assigned to UpdateFailed exception (in #161) is supposed to be seconds and not timedelta() which was resulting in following exception.

2026-04-19 10:04:52.913 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (task: None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 296, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 563, in _async_refresh
    self._schedule_refresh()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 270, in _schedule_refresh
    next_refresh = int(loop.time()) + self._microsecond + update_interval
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'float' and 'datetime.timedelta'

To test define this static field on class WinixDriver: load_test_counter = 0 and this block to the beginning of get_state:

        WinixDriver.load_test_counter += 1

        if WinixDriver.load_test_counter == 2:
            raise WinixTransientError(f"{self.device_id} simulated transient error for testing")

The value assigned to UpdateFailed exception is suppsed to be seconds and not timedelta().
@iprak
Copy link
Copy Markdown
Owner Author

iprak commented Apr 19, 2026

@mfncl9991 FYI, it seems we didn't test #161 well enough.

@iprak iprak merged commit 91fb93e into main Apr 19, 2026
2 checks passed
@mfncl9991
Copy link
Copy Markdown
Contributor

@mfncl9991 FYI, it seems we didn't test #161 well enough.

Thanks for the heads up. Noted. Anything specific to generate the error, or just simply running the integration with the changed files in the branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants