Skip to content

Add reconnect logic for handling update failures in DbusService#250

Merged
henne49 merged 15 commits intomainfrom
feature/reconnect-after-x-minutes
Sep 12, 2025
Merged

Add reconnect logic for handling update failures in DbusService#250
henne49 merged 15 commits intomainfrom
feature/reconnect-after-x-minutes

Conversation

@0x7878
Copy link
Copy Markdown
Collaborator

@0x7878 0x7878 commented May 18, 2025

Introduce reconnect logic to manage update failures for AhoyDTU/OpenDTU, including status code handling and comprehensive tests. Refactor existing tests for clarity and improved setup.
Resolves #249

Comment thread config.example Outdated
Comment thread dbus_service.py Outdated
Comment thread dbus_service.py Outdated
Comment thread dbus_service.py Outdated
Comment thread dbus_service.py Outdated
Comment thread dbus_service.py Outdated
Comment thread dbus_service.py
Comment thread dbus_service.py Outdated
Comment thread dbus_service.py Outdated
Comment thread tests/test_dbus_service.py
0x7878 added 8 commits May 26, 2025 21:47
- Introduced ErrorMode configuration to switch between "retrycount" and "timeout" modes.
- Updated DbusService to handle error states based on the selected mode.
- Enhanced unit tests to cover new timeout behavior and ensure correct status code handling.
…n normal operation and add unit tests for successful update scenarios
- Added error handling mode and related configuration options to config.example.
- Refactored DbusService to initialize and load error handling properties from configuration.
- Updated unit tests to verify correct reading of error handling configuration values.
Copy link
Copy Markdown
Collaborator

@dsteinkopf dsteinkopf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments.

Comment thread dbus_service.py Outdated
Comment thread dbus_service.py
Comment thread dbus_service.py Outdated
Comment thread dbus_service.py
Comment thread dbus_service.py Outdated
… and update several places accordingly to the code review
Copy link
Copy Markdown
Collaborator Author

@0x7878 0x7878 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erledigt

Copy link
Copy Markdown
Owner

@henne49 henne49 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks OK now

Copy link
Copy Markdown
Collaborator

@dsteinkopf dsteinkopf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is functional ok. But after working on it for so long, we should clean it completely.

Comment thread tests/test_dbus_service.py Outdated
Comment thread dbus_service.py Outdated
@0x7878
Copy link
Copy Markdown
Collaborator Author

0x7878 commented Sep 11, 2025

I found another name for the variable. Please take a look at this.

@dsteinkopf
Copy link
Copy Markdown
Collaborator

I found another name for the variable. Please take a look at this.

I like that. Nice :-)

Copy link
Copy Markdown
Collaborator

@dsteinkopf dsteinkopf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything of fine now in my eyes. Good work. Thank you.

@henne49 henne49 merged commit d107368 into main Sep 12, 2025
4 checks passed
dsteinkopf added a commit that referenced this pull request Sep 14, 2025
* Add reconnect logic for AhoyDTU/OpenDTU after failed update attempts

* Add reconnect logic tests for DbusService to handle update failures

* Refactor DbusService tests to reset meter data and clean up comments

* Implement reconnect logic in DbusService to handle update failures and manage status codes

* Refactor ReconnectLogicTest to improve setup and add comprehensive tests for reconnect behavior and status code handling

* Enhance reconnect logic in DbusService and configuration files to improve error handling and retry mechanisms

* Add configuration options for retry logic in README and config.example

* Refactor status code handling in DbusService to use constants and improve update logic

* Add error handling modes and update logic in DbusService and tests

- Introduced ErrorMode configuration to switch between "retrycount" and "timeout" modes.
- Updated DbusService to handle error states based on the selected mode.
- Enhanced unit tests to cover new timeout behavior and ensure correct status code handling.

* Refactor DbusService update logic to ensure _refresh_data is called in normal operation and add unit tests for successful update scenarios

* Add error handling modes to README and config.example for improved error management

* Enhance error handling configuration in DbusService and tests

- Added error handling mode and related configuration options to config.example.
- Refactored DbusService to initialize and load error handling properties from configuration.
- Updated unit tests to verify correct reading of error handling configuration values.

* Refactor error handling logic in DbusService to fix the retry condition

* Refactor error handling configuration in DbusService to use constants and update several places accordingly to the code review

* minor changes
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.

Script sends last value continusly when communication is aborted

3 participants