-
Notifications
You must be signed in to change notification settings - Fork 2
Re-instate tooling and align with Core/Python-plugwise approach #263
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
|
Warning Rate limit exceeded@CoMPaTech has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 41 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (12)
WalkthroughThis update modernizes and consolidates development tooling, focusing on linting, formatting, and environment setup. It refactors shell scripts for improved virtual environment handling, replaces and expands pre-commit hooks, updates CI workflows to use Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Shell as Shell Script
participant VEnv as Virtual Env
participant Lint as Linter (ruff/biome)
participant CI as GitHub Actions
Dev->>Shell: Run setup/test/lint script
Shell->>VEnv: Check/activate/create venv (uv or python3)
Shell->>Shell: Install dependencies (uv pip install)
Shell->>Lint: Run ruff/biome/pylint/pre-commit
Lint-->>Shell: Linting results
Shell-->>Dev: Output results
Dev->>CI: Push/PR triggers workflow
CI->>Shell: Setup environment (uv, pip, etc.)
CI->>Lint: Run ruff/biome checks
Lint-->>CI: Linting results
CI-->>Dev: CI status/reports
Possibly related PRs
Suggested reviewers
Poem
✨ 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 (
|
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: 2
🧹 Nitpick comments (8)
CHANGELOG.md (1)
5-6: Include PR reference in changelog entry.
The new maintenance entry doesn't reference the PR number/link. Please prepend the PR link similar to the other entries, e.g.:
- PR [#263](https://github.com/plugwise/python-plugwise-usb/pull/263): Maintenance chores and re-instatement of ruff, deprecate pre-commit cloud runs (leveraging renovate)scripts/complexity.sh (1)
6-20: Reduce redundancy inmy_pathassignment.
my_pathis set twice viagit rev-parse; the second assignment (line 11) is unnecessary.Consider removing the duplicate assignment so the script reuses the initial
my_path.- my_path=$(git rev-parse --show-toplevel) + # reuse existing my_path from abovescripts/setup.sh (2)
2-3: Optional: Clarify provenance comment
The copy notice andset -eusage are clear and appropriate. Consider specifying the original HA-core version or date more precisely if provenance tracking is required.
19-20: Refactor long pip install command
This singleuv pip installinvocation works but is hard to read. Consider splitting it over multiple lines with backslashes for maintainability..github/workflows/verify.yml (1)
160-164: Introduce Biome linting in commitcheck
Adding a Biome step is aligned with.pre-commit-config.yaml. Consider caching the downloaded biome binary to speed up runs.You might add a cache action on
./tmp/biometo avoid re-downloading each run.scripts/setup_test.sh (1)
7-15: Create venv viauvwhen available
Usinguv venv venvif present, otherwise falling back topython3 -m venv, is robust.You could simplify the command-existence check:
- if [ -x "$(command -v uv)" ]; then + if command -v uv >/dev/null 2>&1; thento avoid testing
-xon a symlink.scripts/tests_and_coverage.sh (1)
5-7: Guard against undefinedOSTYPE
InitializingOSTYPEavoids unbound-var errors underset -u. Using${OSTYPE:-}is more idiomatic:- OSTYPE="${OSTYPE-}" + OSTYPE="${OSTYPE:-}"pyproject.toml (1)
112-359: Bulk import of Pylint disables from Core
This extensive disable list mirrors Core’s configuration. Consider pruning entries as code evolves.You may revisit and remove entries for rules already covered by Ruff or Biome over time.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (41)
.github/workflows/verify.yml(7 hunks).pre-commit-config.yaml(3 hunks)CHANGELOG.md(1 hunks)plugwise_usb/__init__.py(7 hunks)plugwise_usb/api.py(1 hunks)plugwise_usb/connection/__init__.py(1 hunks)plugwise_usb/connection/queue.py(3 hunks)plugwise_usb/connection/receiver.py(1 hunks)plugwise_usb/connection/sender.py(4 hunks)plugwise_usb/constants.py(1 hunks)plugwise_usb/helpers/cache.py(4 hunks)plugwise_usb/helpers/util.py(2 hunks)plugwise_usb/messages/__init__.py(1 hunks)plugwise_usb/messages/properties.py(2 hunks)plugwise_usb/messages/requests.py(2 hunks)plugwise_usb/messages/responses.py(2 hunks)plugwise_usb/network/__init__.py(2 hunks)plugwise_usb/network/cache.py(1 hunks)plugwise_usb/nodes/celsius.py(1 hunks)plugwise_usb/nodes/circle.py(2 hunks)plugwise_usb/nodes/circle_plus.py(2 hunks)plugwise_usb/nodes/helpers/__init__.py(1 hunks)plugwise_usb/nodes/helpers/counter.py(3 hunks)plugwise_usb/nodes/helpers/pulses.py(4 hunks)plugwise_usb/nodes/helpers/subscription.py(2 hunks)plugwise_usb/nodes/node.py(5 hunks)plugwise_usb/nodes/scan.py(5 hunks)plugwise_usb/nodes/sed.py(1 hunks)plugwise_usb/nodes/sense.py(2 hunks)plugwise_usb/nodes/stealth.py(1 hunks)plugwise_usb/nodes/switch.py(3 hunks)pyproject.toml(8 hunks)scripts/complexity.sh(1 hunks)scripts/python-venv.sh(0 hunks)scripts/run-in-env.sh(1 hunks)scripts/setup.sh(1 hunks)scripts/setup_test.sh(1 hunks)scripts/tests_and_coverage.sh(2 hunks)setup.cfg(0 hunks)tests/stick_test_data.py(1 hunks)tests/test_usb.py(3 hunks)
💤 Files with no reviewable changes (2)
- setup.cfg
- scripts/python-venv.sh
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/verify.yml
104-104: shellcheck reported issue in this script: SC2086:info:5:83: Double quote to prevent globbing and word splitting
(shellcheck)
104-104: shellcheck reported issue in this script: SC2086:info:6:14: Double quote to prevent globbing and word splitting
(shellcheck)
104-104: shellcheck reported issue in this script: SC2086:info:8:17: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (120)
plugwise_usb/messages/properties.py (2)
12-14: Formatting: Multiline assignment for DESERIALIZE_ERROR enhances readability
Splitting the error message across lines improves maintainability without altering functionality.
396-398: Simplify zero handling in LogAddr.deserialize
Directly assigning0removes an unnecessary cast while preserving behavior.plugwise_usb/constants.py (1)
2-2: Approve formatting update.
Whitespace-only change: added blank line after the module docstring to improve readability and maintain consistent style.plugwise_usb/nodes/celsius.py (1)
5-5: Approve formatting update.
Added blank line after the module docstring for consistency with style guidelines. No functional change.plugwise_usb/messages/__init__.py (1)
22-22: Approve formatting update.
Inserted a newline between thePriorityenum and thePlugwiseMessageclass to enhance readability and maintain code style consistency.plugwise_usb/nodes/stealth.py (1)
2-2: Approve formatting update.
Blank line added after the module docstring to align with the project's whitespace conventions.plugwise_usb/connection/receiver.py (1)
516-516: Approve formatting update.
Trailing newline inserted before the endregion marker for consistency. No behavioral impact.plugwise_usb/nodes/sense.py (2)
56-56: Whitespace-only change in debug log is fine
No behavioral impact; keeps logging consistent.
96-104: Region marker spacing improves readability
Purely stylistic; no issues.plugwise_usb/network/cache.py (1)
37-39: Multiline string composition is clearer
Parentheses avoid line-length warnings while keeping logic intact.plugwise_usb/nodes/helpers/__init__.py (1)
28-34: Added blank lines for visual separation
Makes the decorator easier to scan; no functional change.plugwise_usb/connection/sender.py (4)
51-51: Removal of redundant blank line is harmless
Keeps section compact.
82-85: Wrapped long debug log across lines
Enhances readability without touching logic.
111-115: Consistent multiline formatting for debug statement
Good stylistic alignment with earlier change.
129-131: Follow-up debug log formatting looks good
No concerns.plugwise_usb/nodes/helpers/subscription.py (2)
23-23: Trimmed extra blank line after class docstring
Keeps class definition tight; fine.
61-63: Line-wrapped append call for clarity
Readability improvement only.plugwise_usb/api.py (2)
236-236: Consistent blank line beforeSenseStatisticsdataclass.This formatting aligns with project style and improves readability.
244-244: Add blank line beforePlugwiseNodeprotocol declaration.Ensures logical grouping and visual separation of API definitions.
plugwise_usb/nodes/sed.py (1)
241-242: Remove extraneous blank line afterreturn False.Formatting-only change; no impact on logic.
plugwise_usb/nodes/circle.py (2)
503-503: Reformat_LOGGER.debugcall for energy log slot.Consolidated the multiline logging invocation for consistency.
991-991: Normalize spacing in_node_info_load_from_cachedebug call.Minor formatting tweak; no functional changes.
tests/stick_test_data.py (2)
63-64: Formatting tweak looks goodThe added space in the
hw_vercomment improves readability and complies with the new linting rules.
67-72: Colon-spacing nit only – OKThe extra space after the dictionary key marker is purely stylistic and has no behavioural impact.
plugwise_usb/helpers/util.py (2)
2-2: Blank line after doc-string – fineNo functional impact; keeps Ruff happy.
25-26: Type-hint spacing aligned with PEP 604The new signature
tuple[str | None, str]improves readability without altering behaviour.plugwise_usb/network/__init__.py (3)
261-263: Logging re-formatted – clear & lazy-formattedThe multi-line
_LOGGER.debugkeeps the format-string/args style intact, so there’s no overhead from f-strings.
561-564: Validation message wrapped – no logic changeOnly the error text was re-wrapped; validation logic remains identical.
565-567: Debug message split – consistent styleSame content, just reflowed; all good.
plugwise_usb/connection/__init__.py (1)
212-220: One-liner request construction – still compliantCollapsing the request instantiation onto one line doesn’t affect readability or complexity here.
plugwise_usb/connection/queue.py (3)
78-80: Trailing-whitespace cleanup – OK
106-108: Lower log-level kept for expected ping timeoutsSplitting the debug statement is fine; behaviour unchanged.
151-154: Queue-depth warning wrapped – clearReformatted logging only; logic intact.
plugwise_usb/messages/responses.py (5)
781-781: Formatting: Simplify default log_data entry
Theelsefallback now explicitly assigns(None, None)for clarity and consistency.
785-785: Formatting: Simplify default log_data entry
Consistent fallback for the second log entry maintains readability.
789-789: Formatting: Simplify default log_data entry
Consistent fallback for the third log entry maintains readability.
793-793: Formatting: Simplify default log_data entry
Consistent fallback for the fourth log entry maintains readability.
859-859: Simplify switch_state property
Removed unnecessary parentheses; return expression is now more concise.plugwise_usb/helpers/cache.py (9)
56-57: Clarify initialization error message
The multi-line raise for a missing cache folder is now clearly formatted.
64-64: Formatting: Assign cache file path
Consistent spacing around assignment improves readability.
83-83: Fix docstring formatting
Corrected the docstring to properly describe thewrite_cachemethod.
85-87: Clarify precondition check in write_cache
RaisedCacheErroris now formatted across multiple lines for clarity.
120-120: Improve debug log formatting
Aligned formatting of the debug call for consistency.
126-127: Clarify initialization precondition in read_cache
Enhanced readability of the error raise when cache isn't initialized.
132-134: Improve debug log for empty cache
Multi-line debug statement now follows consistent style.
156-157: Format warning on invalid cache line
Streamlined logging call across multiple lines for consistency.
159-159: Consistent assignment in read_cache loop
Assignment now properly aligned with surrounding code.plugwise_usb/messages/requests.py (2)
314-320: Refactor_send_requestsignature
Method signature has been split across lines for better readability.
1268-1268: Trim trailing whitespace in docstring
Removed extra space at the end of theResponse messageline.plugwise_usb/nodes/scan.py (4)
52-52: Formatting: Sensitivity medium constant
Aligned assignment with surrounding constants for consistency.
176-180: Reformat complex conditional in_motion_from_cache
Split the multi-partifcondition across lines to improve clarity.
363-365: Align arguments ingathercall
Each coroutine inawait gather(...)is now on its own line for readability.
482-484: Reformatsensitivity_map.getcall
Method parameters are now on separate lines for PEP 8 compliance.plugwise_usb/nodes/helpers/pulses.py (3)
10-11: Approve import ofMINUTE_IN_SECONDS.Grouping and importing the new constant alongside
DAY_IN_HOURSandLOGADDR_MAXis correct and keeps related time-based constants together.
172-177: Enhance debug logging with production flag.Including
self._log_productionin the debug call provides full context for consumption vs. production, aiding future troubleshooting.
523-525: Maintain correct boolean XOR grouping.The multi-line formatting around the
^operator preserves readability and the parentheses ensure the intended XOR between the two timestamp comparisons.plugwise_usb/nodes/node.py (2)
346-348: Preserve logical grouping in_setup_protocol.The split condition with parentheses maintains the intended range check on
required_versionwhile improving line-length compliance.
537-539: Refactormodel_infoassignment for clarity.Breaking the single-line list into multiple lines makes the conditional fallback logic more readable.
plugwise_usb/__init__.py (6)
23-25: Extract constant for uninitialized-stick error.Defining
NOT_INITIALIZED_STICK_ERRORcentralizes the error message and avoids duplication inload_nodes.
175-177: Prevent changing port while connected.Adding this guard ensures the stick’s port cannot be modified mid-connection, preventing inconsistent states.
188-191: Simplify energy reset flow with walrus operator.The use of
if result := await ...cleanly captures the outcome and reduces temporary variables.
234-238: Clarify subscription error when network uninitialized.Raising
SubscriptionErrorwith a descriptive message aligns with expectations when_networkis missing.
268-270: Improve exception message formatting inconnect.Splitting the f-string into logical parts enhances readability while preserving content.
316-318: Refine load-nodes error handling.Raising
StickError("Cannot load nodes when network is not started")clarifies the precondition forload_nodes..pre-commit-config.yaml (9)
7-15: Re-enable and upgraderuffhooks with auto-fix.Bringing back
ruff@v0.11.13and separatingruff(with--fix) fromruff-formataligns with the Core/Python-plugwise tooling approach.
20-20: Add explicit name forcheck-executables-have-shebangshook.Naming the hook improves clarity when listing and running hooks manually.
23-26: Configureno-commit-to-branchwith explicit args and name.Setting
--branch=mainand naming the hook enforces branch-protection locally consistent with CI.
30-31: Namepyupgradehook explicitly.The new
"Checking pyupgrade"label makes its purpose clearer in the pre-commit report.
36-40: Refinecodespellhook arguments.Updating ignore and skip lists, along with quiet-level settings, centralizes spelling rules and matches the removed
setup.cfg.
46-46: Renamebandithook for consistency.Using
"Bandit checking"aligns the naming style across security hooks.
62-63: Configurebiome-lintadditional dependencies.Specifying
@biomejs/biome@1.8.3ensures consistent formatting versions in local and CI runs.
70-71: Explicit name and stage forpython-typing-update.The
"Python typing"label and[manual]stage clarify when and how the hook should be run.
77-83: Add and configureshellcheckhook.Introducing
shellcheckwith--external-sourcesstrengthens shell script linting in setup workflows.plugwise_usb/nodes/helpers/counter.py (3)
83-88: Formatting readability improvement.
The multi-lineifcondition enhances readability without changing behavior.
163-168: Consistent multi-line formatting.
Restructuring the tuple unpacking and method call across multiple lines aligns with the project's style.
301-305: Maintain style consistency.
Expanding thereplace(...)call over multiple lines improves clarity.plugwise_usb/nodes/switch.py (3)
56-62: Expanded protocol features tuple.
The multi-line layout forNodeFeatureconstants improves maintainability and matches the style elsewhere.
93-97: Consistent region marker
Changing#endregionto# endregionaligns with the common formatting of code regions across the codebase.
105-108: Ensure trailing comma ingathercall.
Adding the comma prevents syntax errors if additional calls are appended later.plugwise_usb/nodes/circle_plus.py (3)
11-14: Reordered and formatted imports for clarity.
The multi-line grouping of request imports aligns with PEP8 and the project's import style.
18-19: Separated firmware import.
Moving the firmware support import to its own line enhances readability and keeps grouping consistent.
133-136: Docstring formatting.
Adding a blank line after theReturns:section maintains consistency in docstring structure.scripts/complexity.sh (1)
22-26: Run complexity analysis unconditionally.
Extracting theradoncommand outside the conditional ensures it always runs, matching changes in other scripts.scripts/setup.sh (3)
5-13: Env detection and venv creation
The inline logic correctly checks for an activeVIRTUAL_ENVbefore creating one withuvorpython3 -m venv. Ensure existingvenvdirectories are preserved or handled gracefully if re-running this script.
15-17: Installuvinto the venv
Installinguvviapython3 -m pipis safe whenvenvis activated. Confirm that pip is using the venv’s environment to avoid polluting the global site-packages.
22-23: Install pre-commit hook
A directpre-commit installis sufficient. Ensure CI workflows include this step if hooks are expected in automated checks.scripts/run-in-env.sh (4)
1-2: Shebang and attribution
Using/usr/bin/env shand noting the HA-core origin is fine for portability and context.
7-15: DefaultOSTYPEand pyenv support
The fallback forOSTYPEand the.python-versionhandling correctly integrate pyenv.
17-31: Virtualenv activation logic
Fallback search for common venv directories and sourcing the activate script is robust. Consider logging a warning if no venv is found and none is created upstream.
33-33: Command execution
Usingexec "$@"ensures the script replaces itself with the target command. This is the correct pattern.tests/test_usb.py (1)
785-789: Multi-line tuple formatting
The refactoredfeaturestuple intest_node_relay_and_powerimproves readability. The trailing comma inside a multi-line literal is correct..github/workflows/verify.yml (7)
7-7: Bump cache version for environment venv
UpdatingCACHE_VERSIONto 25 invalidates stale caches as intended.
16-16: Confirm disabling of pull_request trigger
Thepull_requestevent is commented out; ensure this is intentional so that PRs won’t run the verify workflow.
51-53: Useuvwrapper consistently for pip installs
Switching topip install uvanduv pip install …aligns with the repository’s tooling move. Good catch.
101-101: Enable actual Ruff checks
Changing from a no-op toruff check plugwise_usb/ tests/correctly enforces lint rules.
106-106: Commit-formatted fixes with Ruff
Runningruff formaton failures will auto-correct style issues. This matches pre-commit hooks.
203-208: Adoptuvprefix in test-cache setup
All test dependencies now install viauv pip install, consistent with setup scripts.
284-288: Clarify MyPy skip logic
Theuv pip list | grep -i mypyline doesn’t gate the skip message; the script always echoes “skipping”. Verify that this is the desired behavior for issue #171.scripts/setup_test.sh (6)
2-3: Documented origin of script
The new header clearly attributes this to HA-core and explains local adjustments.
17-19: Ensureuvis installed
Conditionally installinguvif missing guarantees the wrapper is available.
24-24: Install test requirements withuv
Singleuv pip install --upgrade -e . -r ...simplifies dependency management.
33-33: Error on unknown processor
The exit-2 path ensures failure on unrecognized architectures.
38-38: Make Biome CLI executable
Granting execution rights is necessary for downstream usage.
41-43: Conditional pre-commit hook install
Installing hooks only when no args are passed avoids re-installation on CI.scripts/tests_and_coverage.sh (9)
2-3: Copied from HA-Core with local adaptations
The header comment acknowledges provenance and intent.
12-16: Loadpyenvconfiguration if present
Reading.python-versionfor pyenv compatibility is a welcome addition.
17-30: Activate existing virtualenvs robustly
The loop overvenv,.venv,.under the repo root is comprehensive.
39-44: Centralize error handling inhandle_command_error
Encapsulating exit status checks improves script readability.
46-49: Addbiome_formathelper
Automating Biome formatting with error propagation is consistent.
52-54: Install and update dependencies viauv
Pre-commit hooks and pip installs are properly sequenced.
63-67: Integrate Biome and Ruff in lint stage
Runningbiome_formatthenruff checkmatches the CI workflow.
68-72: Auto-formatting on Ruff failures
Callingruff formatand handling errors ensures consistent style.
76-77: Validate lint with Pylint
The addition ofpylintwith error handling finalizes the lint tasks.pyproject.toml (7)
43-43: Enable type hint publishing
Adding"plugwise_usb" = ["py.typed"]ensures PEP 561 compatibility for type checkers.
48-56: Document Core alignment markers
The comment block marking Core-aligned disables provides context.
58-72: Configure Pylintinit-hookfor Core plugins
Pointing topylint/pluginsfrom upstream Core is correct. Verify that this path exists in the project.
78-83: Extend Pylintextension-pkg-allow-list
Allow-listingavandorjsonmodules matches known dependencies. Confirm these packages are imported elsewhere.
86-88: Fail on Pylint info-level messages
Enforcing noImessages tightens quality gates.
95-101: Clarify disabled Pylint messages reasons
The commented rationale for disables (e.g., format vs. Ruff) aids future cleanup.
528-532: Customize import aliases for Ruff
Adding aliases for Home Assistant submodules prevents lint failures during imports.
|
Dropped pre-commit.ci access from both usb repos |
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 comments (2)
.github/workflows/verify.yml (2)
103-113: Fix push-based auto-fix commit logic.
Whenpull_requestis disabled,$GITHUB_HEAD_REFis empty in apushrun, causinggit checkout $GITHUB_HEAD_REFto fail. Usegithub.ref_nameor derive the branch name from the event context.Suggested diff:
- git checkout $GITHUB_HEAD_REF + git checkout "${{ github.ref_name }}"
149-153: Correct failure check for pre-commit cache.
The “Fail job if cache restore failed” step referencessteps.cache-venv.outputs.cache-hitinstead ofsteps.cache-precommit.outputs.cache-hit.Apply:
- if: steps.cache-venv.outputs.cache-hit != 'true' + if: steps.cache-precommit.outputs.cache-hit != 'true'
🧹 Nitpick comments (3)
.pre-commit-config.yaml (2)
36-41: Remove inline “remove before merge” comment in codespell args.
The# Previous list, remove before mergecomment breaks theargslist. Move any legacy ignore words into a separate doc or remove this annotation.
94-97: Fix missing parenthesis in hookname.
Thesetup_testhook’sname: "Setup (extended for testing"is missing a closing).scripts/setup_test.sh (1)
1-4: Re-introducedset -eonly (removed-u).
Dropping-uallows undefined variables to pass silently. Was this intentional to avoid failures on unbound vars?Consider reinstating
set -o nounsetor adding explicit checks for required variables.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (34)
.github/workflows/verify.yml(7 hunks).pre-commit-config.yaml(2 hunks)plugwise_usb/__init__.py(7 hunks)plugwise_usb/api.py(1 hunks)plugwise_usb/connection/__init__.py(1 hunks)plugwise_usb/connection/queue.py(3 hunks)plugwise_usb/connection/receiver.py(1 hunks)plugwise_usb/connection/sender.py(4 hunks)plugwise_usb/constants.py(1 hunks)plugwise_usb/helpers/cache.py(4 hunks)plugwise_usb/helpers/util.py(2 hunks)plugwise_usb/messages/__init__.py(1 hunks)plugwise_usb/messages/properties.py(1 hunks)plugwise_usb/messages/requests.py(2 hunks)plugwise_usb/messages/responses.py(2 hunks)plugwise_usb/network/__init__.py(2 hunks)plugwise_usb/network/cache.py(1 hunks)plugwise_usb/nodes/celsius.py(1 hunks)plugwise_usb/nodes/circle.py(2 hunks)plugwise_usb/nodes/circle_plus.py(1 hunks)plugwise_usb/nodes/helpers/__init__.py(1 hunks)plugwise_usb/nodes/helpers/counter.py(3 hunks)plugwise_usb/nodes/helpers/pulses.py(3 hunks)plugwise_usb/nodes/helpers/subscription.py(2 hunks)plugwise_usb/nodes/node.py(5 hunks)plugwise_usb/nodes/scan.py(5 hunks)plugwise_usb/nodes/sed.py(1 hunks)plugwise_usb/nodes/sense.py(2 hunks)plugwise_usb/nodes/stealth.py(1 hunks)plugwise_usb/nodes/switch.py(3 hunks)scripts/pre-commit.sh(0 hunks)scripts/setup_test.sh(1 hunks)tests/stick_test_data.py(1 hunks)tests/test_usb.py(3 hunks)
💤 Files with no reviewable changes (1)
- scripts/pre-commit.sh
✅ Files skipped from review due to trivial changes (10)
- plugwise_usb/connection/receiver.py
- plugwise_usb/constants.py
- plugwise_usb/nodes/circle_plus.py
- plugwise_usb/nodes/stealth.py
- plugwise_usb/connection/init.py
- plugwise_usb/nodes/helpers/init.py
- plugwise_usb/nodes/helpers/subscription.py
- plugwise_usb/messages/requests.py
- plugwise_usb/init.py
- plugwise_usb/messages/properties.py
🚧 Files skipped from review as they are similar to previous changes (20)
- plugwise_usb/nodes/celsius.py
- plugwise_usb/messages/init.py
- plugwise_usb/network/cache.py
- plugwise_usb/nodes/sense.py
- plugwise_usb/nodes/helpers/counter.py
- plugwise_usb/connection/queue.py
- plugwise_usb/api.py
- plugwise_usb/connection/sender.py
- tests/stick_test_data.py
- plugwise_usb/nodes/sed.py
- plugwise_usb/helpers/cache.py
- plugwise_usb/helpers/util.py
- plugwise_usb/network/init.py
- plugwise_usb/nodes/helpers/pulses.py
- plugwise_usb/nodes/node.py
- plugwise_usb/nodes/switch.py
- plugwise_usb/messages/responses.py
- plugwise_usb/nodes/scan.py
- plugwise_usb/nodes/circle.py
- tests/test_usb.py
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/verify.yml
104-104: shellcheck reported issue in this script: SC2086:info:5:91: Double quote to prevent globbing and word splitting
(shellcheck)
104-104: shellcheck reported issue in this script: SC2086:info:6:14: Double quote to prevent globbing and word splitting
(shellcheck)
104-104: shellcheck reported issue in this script: SC2086:info:8:17: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (15)
.pre-commit-config.yaml (13)
7-14: Re-enabled and split Ruff hooks look solid.
Reinstating theruffhook with--fixand a separateruff-formathook is aligned with Core/Python-plugwise standards.
20-23: Explicit naming for built-in pre-commit hooks is clear.
check-executables-have-shebangsandno-commit-to-branchnow have descriptivenamefields.
30-31: PyUpgrade hook naming update is good.
Having a consistent hooknameenhances readability in hook logs.
46-52: Bandit configuration is correctly scoped.
Specifying--configfileand limitingfilestoplugwise_usbandtestsdirectories is good practice.
56-57: YAML lint hook name clarified.
Adding"YAML linting"improves hook UI.
62-63: Biome lint hook additional dependency pinned.
Locking@biomejs/biome@1.8.3ensures deterministic formatting.
70-76: Manual Python typing hook setup is fine.
Leavingpython-typing-updateas a manual hook fits an infrequent migration workflow.
78-83: ShellCheck hook with--external-sourcesis appropriate.
This will catch issues in sourced scripts.
90-94: Localsetuphook logic is clear.
Using a wrapper to ensurevenvexists before other hooks run is aligned with the new scripting approach.
105-110: PyLint hook configuration is well-defined.
Invokingpylint -j 0for all Python files underplugwise_usb/is appropriate.
112-117: Testing hook withNO_FIXTURES="1"is intentional and documented.
Running tests without fixtures in CI aligns with upstream conventions.
117-121: Biome local hook ready for unknown file types.
Good to have--files-ignore-unknown=true.
125-126: MarkdownLint hook naming updated.
Clear hook names improve readability..github/workflows/verify.yml (2)
15-17: Verify removal ofpull_requesttrigger.
Disabling thepull_requestevent stops CI from running on GitHub PRs. Confirm this aligns with your intent to only run onpush,workflow_dispatch, and a schedule.
51-54: Ensureuvtool is available on runner.
You installuvafter creating the venv, but subsequentuv pip installcalls assume it’s onPATH. Confirm no intermittent path issues.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #263 +/- ##
=======================================
Coverage 81.12% 81.12%
=======================================
Files 36 36
Lines 7502 7502
=======================================
Hits 6086 6086
Misses 1416 1416 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@CodeRabbit summary |
bouwew
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.
Thanks @CoMPaTech !
✅ Actions performedSummary regeneration triggered. |



Note: not using the custom-component in python-plug wise yet
Re-instating ruff (though handicapped, see notes in #171 as a todo list to clean up in
pyproject.tomland not touchline mypy yet (that still is disabled): as discussed on discordpyproject.toml, uncomment it and runruff check plugwise_usb/and amend towards it's suggestions.venvand re-run the setup-scripts (i.e. moving towardsuvagain)Summary by CodeRabbit
Chores
Refactor