Skip to content

flake8 upgrade#3635

Merged
LKuemmel merged 2 commits into
openWB:masterfrom
benderl:flake8-upgrade
Jul 7, 2026
Merged

flake8 upgrade#3635
LKuemmel merged 2 commits into
openWB:masterfrom
benderl:flake8-upgrade

Conversation

@benderl

@benderl benderl commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
  • upgrade flake8 version to 7.3.0
  • fix warnings and errors reported by flake8

@benderl benderl added the python Pull requests that update Python code label Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/nonlocal declarations across many modules and samples to satisfy new lint rules.
  • Minor safe/cleanup adjustments (e.g., avoid closing a None socket; 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.

@benderl benderl requested a review from LKuemmel July 7, 2026 11:05
@LKuemmel LKuemmel merged commit 720595d into openWB:master Jul 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants