-
Notifications
You must be signed in to change notification settings - Fork 8
Improve timeout setting #627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes involve the removal of the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #627 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 3360 3365 +5
=========================================
+ Hits 3360 3365 +5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (1)
plugwise/helper.py (1)
Line range hint
1-1000: Overall, the changes improve timeout handling but may require additional testing.The modifications to the constants and the SmileComm class init method improve the timeout handling as per the PR objectives. However, these changes may have implications for the overall system behavior, especially for users with legacy setups. Consider the following:
- Ensure comprehensive testing is done for both default and legacy timeout scenarios.
- Update the documentation to reflect these changes, especially regarding the new timeout behavior.
- Consider adding unit tests specifically for the new timeout logic.
To further improve the robustness of the system, consider implementing a configuration system that allows users to override these timeout values if needed, perhaps through environment variables or a configuration file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (6)
- plugwise/init.py (0 hunks)
- plugwise/helper.py (2 hunks)
- plugwise/legacy/helper.py (0 hunks)
- plugwise/legacy/smile.py (0 hunks)
- plugwise/smile.py (0 hunks)
- tests/test_init.py (6 hunks)
💤 Files not reviewed due to no reviewable changes (4)
- plugwise/init.py
- plugwise/legacy/helper.py
- plugwise/legacy/smile.py
- plugwise/smile.py
🔇 Additional comments not posted (5)
plugwise/helper.py (1)
19-21: LGTM. Please clarify the usage of these new constants.The addition of
DEFAULT_LEGACY_TIMEOUT,DEFAULT_TIMEOUT, andDEFAULT_USERNAMEconstants is good for maintaining consistency and ease of configuration. However, it would be helpful to have a brief comment explaining their purpose and how they relate to the improved timeout setting mentioned in the PR description.✅ Verification successful
Verification Successful. The new constants
DEFAULT_LEGACY_TIMEOUT,DEFAULT_TIMEOUT, andDEFAULT_USERNAMEare appropriately used across the codebase without any issues.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the usage of the new constants in the codebase rg "DEFAULT_LEGACY_TIMEOUT|DEFAULT_TIMEOUT|DEFAULT_USERNAME" --type pythonLength of output: 107
Script:
#!/bin/bash # Verify the usage of the new constants in the codebase with corrected file type rg "DEFAULT_LEGACY_TIMEOUT|DEFAULT_TIMEOUT|DEFAULT_USERNAME" --type pyLength of output: 1075
tests/test_init.py (4)
370-372: Username Assignment Based on 'stretch' Parameter Looks GoodThe logic for assigning
user_namebased on thestretchparameter is clear and correct.
406-406: Passinguser_nameto Smile ObjectPassing
username=user_nameto theSmileobject ensures the correct username is used based on thestretchparameter. This change is appropriate.Also applies to: 419-419
426-429: Correct Timeout Assertion Based on UsernameThe assertions correctly verify that when
user_nameispw_constants.STRETCH, the timeout is 30 seconds; otherwise, it's 10 seconds. This ensures that the timeout setting is validated according to the username.
488-500: Proper Propagation ofstretchParameterPassing the
stretchparameter inconnect_legacy_wrapperensures that thestretchlogic is consistently applied throughout the connection methods. This change maintains the integrity of the test flow.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- CHANGELOG.md (1 hunks)
- pyproject.toml (1 hunks)
🔇 Additional comments not posted (5)
CHANGELOG.md (5)
3-6: LGTM: New version entry is clear and concise.The new version entry for v1.4.2 is well-formatted and provides a clear description of the improvement made to the timeout settings.
Line range hint
8-1080: No changes to existing entries.The entries from v1.4.1 to v1.0.0 remain unchanged. These provide a valuable history of previous changes and improvements to the project.
Line range hint
1082-1109: Historical context preserved.The "Old change log python-plugwise" section maintains important historical information about the former USB-only fork. This is valuable for users transitioning from older versions and for understanding the project's evolution.
Line range hint
1111-1334: Valuable project history maintained.The "Change log former Smile" section preserves the history of the former Plugwise_Smile Network-only module. This information is crucial for understanding the project's evolution, especially the merging of different modules into the current unified project.
Line range hint
1-1334: Excellent changelog structure and completeness.The overall structure and formatting of the changelog are exemplary. It provides a comprehensive history of the project, including recent changes and the evolution from separate modules to a unified project. The consistent formatting and clear version headings make it easy to navigate and understand the project's development over time.
|
Closed, not implemented. A better solution has been implemented in the frontend Integration. |



While adding the config_flow updates in Core Plugwise, I realized we always start with a timeout of 30 secs, so testing a fail takes a long time. Then I thought, we know the password, only if equal to stretch set the timeout to 30 :)
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores