Skip to content

Clean up safe Ruff findings in Stromligning sensor modules#283

Merged
MTrab merged 3 commits intomainfrom
chore/fix-ruff-findings
Apr 3, 2026
Merged

Clean up safe Ruff findings in Stromligning sensor modules#283
MTrab merged 3 commits intomainfrom
chore/fix-ruff-findings

Conversation

@MTrab
Copy link
Copy Markdown
Owner

@MTrab MTrab commented Apr 3, 2026

Description

This PR fixes the safe Ruff findings in the Stromligning sensor and binary sensor modules.

It removes unused imports, avoids import shadowing in setup loops, updates docstrings to satisfy Ruff, and refactors sensor.py so handle_attributes uses explicit attribute maps for ATTR_PRICES and at values.

The state path is intentionally left unchanged: the value_fn definitions, handle_update() assignment to _attr_native_value, and the API methods used for sensor state are untouched.

Test strategy

Ran ruff check custom_components/stromligning/binary_sensor.py custom_components/stromligning/sensor.py.

Known limitations

This PR does not add new tests.

Configuration changes

None.

Proposed semver label

patch (not set in GitHub yet; awaiting maintainer verification before any label change)

@github-actions github-actions Bot added the chore label Apr 3, 2026
@MTrab MTrab changed the title Clean up Ruff findings in Stromligning sensor modules Clean up safe Ruff findings in Stromligning sensor modules Apr 3, 2026
@MTrab MTrab added the patch Bump patch version label Apr 3, 2026
@MTrab MTrab merged commit 1d75c20 into main Apr 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore patch Bump patch version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant