-
Notifications
You must be signed in to change notification settings - Fork 7
Fix for issue #897 #900
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
Fix for issue #897 #900
Conversation
WalkthroughThe test for the Plugwise Anna climate component was updated to set the mocked device's climate mode to "heat_cool" and adjust assertions to expect the corresponding Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (3)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🧬 Code Graph Analysis (1)custom_components/plugwise/climate.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
CoMPaTech
left a comment
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.
Still not sure what intent we have here to test, but that would ensure the assert works :) (+needs upstreaming)
This covers removing the (last remaining) schedule from the Plugwise App. |
CoMPaTech
left a comment
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.
Should have been a comment - and still has the assert failing for auto != heatcool
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
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: 0
🧹 Nitpick comments (2)
custom_components/plugwise/select.py (1)
100-100: Logic change correctly handles empty or null options.The addition of the truthiness check
and device[description.options_key]is appropriate for preventing select entities from being created when the options list is empty orNone. This aligns with the PR objective of handling cases where the last remaining schedule is removed andavailable_schedulesis set toNone.Consider applying the static analysis suggestion to use
dict.getfor cleaner code:- if description.options_key in device and device[description.options_key]: + if device.get(description.options_key):This would achieve the same result more concisely since
dict.getreturnsNonefor missing keys, which is falsy.custom_components/plugwise/manifest.json (1)
10-12: Dependency updated to pre-release version for testing.The update to use pre-release version
1.7.8a2from the test PyPI URL is appropriate for testing the fix for issue #897. This aligns with the project's established practice of using alpha versions from test repositories for testing purposes.Remember to update this to a stable version once the fix is finalized and the package is published to the main PyPI repository.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
custom_components/plugwise/manifest.json(1 hunks)custom_components/plugwise/select.py(1 hunks)tests/components/plugwise/fixtures/legacy_anna/data.json(2 hunks)tests/components/plugwise/fixtures/m_adam_jip/data.json(4 hunks)tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/data.json(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- tests/components/plugwise/fixtures/legacy_anna/data.json
- tests/components/plugwise/fixtures/m_adam_jip/data.json
- tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/data.json
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: bouwew
PR: plugwise/plugwise-beta#671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-06-22T08:05:56.791Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
PR: plugwise/plugwise-beta#671
File: custom_components/plugwise/switch.py:82-83
Timestamp: 2024-10-08T15:35:25.180Z
Learning: User bouwew prefers to ignore exception handling suggestions for the `pw-beta` branch in the `custom_components/plugwise/switch.py` file.
Learnt from: bouwew
PR: plugwise/plugwise-beta#734
File: tests/components/plugwise/test_config_flow.py:58-58
Timestamp: 2024-10-08T15:35:25.180Z
Learning: In `tests/components/plugwise/test_config_flow.py`, the versions are mocked firmware versions for testing purposes and do not need to match the software version in `manifest.json`.
Learnt from: bouwew
PR: plugwise/plugwise-beta#734
File: tests/components/plugwise/test_config_flow.py:58-58
Timestamp: 2024-09-27T09:48:30.890Z
Learning: In `tests/components/plugwise/test_config_flow.py`, the versions are mocked firmware versions for testing purposes and do not need to match the software version in `manifest.json`.
Learnt from: bouwew
PR: plugwise/plugwise-beta#793
File: custom_components/plugwise/manifest.json:10-11
Timestamp: 2024-12-12T19:48:34.652Z
Learning: In the Plugwise integration, temporary use of alpha versions from test repositories is acceptable for testing purposes.
Learnt from: CoMPaTech
PR: plugwise/plugwise-beta#0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
custom_components/plugwise/select.py (1)
Learnt from: CoMPaTech
PR: plugwise/plugwise-beta#0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
custom_components/plugwise/manifest.json (5)
Learnt from: bouwew
PR: plugwise/plugwise-beta#734
File: tests/components/plugwise/test_config_flow.py:58-58
Timestamp: 2024-09-27T09:48:30.890Z
Learning: In `tests/components/plugwise/test_config_flow.py`, the versions are mocked firmware versions for testing purposes and do not need to match the software version in `manifest.json`.
Learnt from: bouwew
PR: plugwise/plugwise-beta#734
File: tests/components/plugwise/test_config_flow.py:58-58
Timestamp: 2024-10-08T15:35:25.180Z
Learning: In `tests/components/plugwise/test_config_flow.py`, the versions are mocked firmware versions for testing purposes and do not need to match the software version in `manifest.json`.
Learnt from: bouwew
PR: plugwise/plugwise-beta#793
File: custom_components/plugwise/manifest.json:10-11
Timestamp: 2024-12-12T19:48:34.652Z
Learning: In the Plugwise integration, temporary use of alpha versions from test repositories is acceptable for testing purposes.
Learnt from: CoMPaTech
PR: plugwise/plugwise-beta#0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: In the plugwise-beta project, `uv` package manager was removed from core-testing.sh in favor of pip due to issues it was causing.
Learnt from: CoMPaTech
PR: plugwise/plugwise-beta#0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
🧬 Code Graph Analysis (1)
custom_components/plugwise/select.py (1)
custom_components/plugwise/entity.py (1)
device(91-93)
🪛 Ruff (0.12.2)
custom_components/plugwise/select.py
100-100: Unnecessary key check before dictionary access
Replace with dict.get
(RUF019)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Prepare
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
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.
❌ Error while testing for Development HA-core:
✔️ Success: No problem with testing against released HA-core.
an empty schedule list means no auto mode
|



Should fix issue #897
Summary by CodeRabbit