flake8 upgrade#3635
Merged
Merged
Conversation
benderl
commented
Jul 7, 2026
Contributor
- upgrade flake8 version to 7.3.0
- fix warnings and errors reported by flake8
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the CI linting setup to Flake8 7.3.0 and updates the codebase to satisfy the newer Flake8 checks, primarily by removing redundant global/nonlocal statements, cleaning up whitespace, and tightening a few small correctness/type-safety edges.
Changes:
- Update GitHub Actions workflow to run Flake8 7.3.0 (via TrueBrain/actions-flake8).
- Remove unnecessary
global/nonlocaldeclarations across many modules and samples to satisfy new lint rules. - Minor safe/cleanup adjustments (e.g., avoid closing a
Nonesocket; import formatting; whitespace cleanup).
Reviewed changes
Copilot reviewed 75 out of 76 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| simpleAPI/simpleAPI_mqtt.py | Remove trailing whitespace/blank-line lint issues. |
| packages/smarthome/smartcommon.py | Remove redundant global declarations to satisfy newer Flake8 rules. |
| packages/modules/vehicles/kia/api.py | Remove redundant global declarations per Flake8. |
| packages/modules/smarthome/mqtt/watt.py | Remove redundant global declarations per Flake8. |
| packages/modules/smarthome/mqtt/on.py | Replace unused global with explicit no-op handler. |
| packages/modules/smarthome/mqtt/off.py | Replace unused global with explicit no-op handler. |
| packages/modules/io_devices/eebus/api.py | Remove redundant nonlocal declarations in nested function. |
| packages/modules/io_devices/dimm_kit/api.py | Remove redundant nonlocal declarations in nested functions. |
| packages/modules/devices/victron/victron/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/victron/victron_3p75ct/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/varta/varta/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/upower/upower/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/thermia/thermia/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/tesla/tesla/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/sungrow/sungrow_sh/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/sungrow/sungrow_sg/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/sungrow/sungrow_micro/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/sungrow/sungrow_ihm/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/studer/studer/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/solis/solis/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/solax/solax/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/solarmax/solarmax/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/solaredge/solaredge/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/solakon/solakon_one/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/sofar/sofar/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/sma/sma_sunny_island/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/sma/sma_sunny_boy/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/sma/sma_shm/speedwire_listener.py | Add proper type annotation and guard socket close. |
| packages/modules/devices/sigenergy/sigenergy/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/siemens/siemens/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/siemens/siemens_sentron/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/shelly/shelly/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/saxpower/saxpower/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/qcells/qcells/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/powerdog/powerdog/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/orno/orno/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/openwb/openwb_pv_kit/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/openwb/openwb_flex/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/openwb/openwb_evu_kit/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/openwb/openwb_bat_kit/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/nibe/nibe/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/mtec/mtec/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/marstek/venus_c_e/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/kostal/kostal_sem/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/kostal/kostal_plenticore/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/kostal/kostal_piko_ci/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/kaco/kaco_tx/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/janitza/janitza/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/idm/idm/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/huawei/huawei/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/huawei/huawei_smartlogger/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/huawei/huawei_emma/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/growatt/growatt/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/good_we/good_we/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/fox_ess/fox_ess/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/fems/fems/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/elgris/elgris/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/e3dc/e3dc/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/deye/deye/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/deye/deye_solarman/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/chint/chint/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/carlo_gavazzi/carlo_gavazzi/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/azzurro_zcs/azzurro_zcs/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/azzurro_zcs/azzurro_zcs_3p/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/anker/anker_solix/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/ampere/ampere/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/alpha_ess/alpha_ess/device.py | Remove redundant nonlocal declarations. |
| packages/modules/devices/algodue/algodue/device.py | Remove redundant nonlocal declarations. |
| packages/helpermodules/logger.py | Remove redundant global declarations per Flake8. |
| packages/control/data.py | Remove redundant global declaration per Flake8. |
| packages/control/chargepoint/chargepoint_data.py | Rename ev field to _ev and provide ev property setter to avoid dataclass/property name clash while preserving API usage. |
| docs/samples/sample_request_by_device/sample_request_by_device/device.py | Reformat long import to satisfy lint rules. |
| docs/samples/sample_request_by_component/sample_request_by_component/device.py | Reformat long import to satisfy lint rules. |
| docs/samples/sample_request_by_component/sample_request_by_component/bat.py | Remove unused import to satisfy lint rules. |
| docs/samples/sample_modbus/sample_modbus/device.py | Reformat long import and remove redundant nonlocal. |
| .github/workflows/github-actions-python.yml | Update CI workflow actions and Flake8 version to 7.3.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LKuemmel
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.