feat(mqtt): offline template bundling, auto-redeploy, and zone-aware presence discovery

Analysed against ad8474e35 files changedby edso404
Open PR on GitHub

Change-risk score

9.4out of 10Elevated
Repository health
2.3to2.4base against this head

This change sits in the top third of this repository's own risk distribution, the band worth reviewing closely. It is riskier than 96% of this repository's own commits.

The largest health movement is in mqtt_presence.py, down 0.7. Nothing outside this PR depends on a contract it changed.

Files changed
5
in this diff
Contracts changed
0
removed or signature
Outside callers
0
not in this diff
Findings added
7
3 resolved

Blast radius on the repo map

Every file in the repository, grouped into its own directories and sized by lines. The ones this PR changes are lit, and everything that imports them is marked.

.githubcustom_components/openwrtdocsscriptstestsapihelperstranslationsluci_rpcsshubus
changed, health fellchanged, health rosechanged, health heldimports a changed fileuntouchedchanged by this PR

Drawing 153 of 155 files at a readable size, grouped by directory and sized by lines of code. 5 changed here reach 5 more by import. 2 are too small to see at this width, which is what the frame below is for.

Inside custom_components/openwrt

apihelperstranslationsluci_rpcsshubus__init__.pybinary_sensor.pybutton.pyconfig_flow.pycoordinator.pydevice_tracker.…diagn…event…image…light…manif…numbe…repai…sensor.pyservices.yamlstrings.jsonswitch.pyupdate.pybase.py__ini…asu.pygps.pymac_ve…mqtt_p…de.jsonen.jsonclie…dev…feature…network.…system.pycli…de…features.pynetwork.pysyst…client.pydevices.pyfeatures.pynetwork.…services.…system.pywire…

52 files, 4 changed by this PR and 5 that import one. This PR changes 5 files in total, spread across more than one top-level directory. Click any directory above to frame it instead.

Changed

What this PR added, and what it took away

Introduced findings are the ones inside the lines this PR added, not the file's existing ones. The resolved column is the only place in the product that lists them.

Introduced (7)
  • highlarge method
    custom_components/openwrt/config_flow.py:2265

    async_step_init is 127 lines long

  • mediumlarge method
    custom_components/openwrt/config_flow.py:2609

    async_step_options_packages is 103 lines long

  • lowprimitive obsession
    custom_components/openwrt/helpers/mqtt_presence.py:36

    async_deploy_mqtt_presence takes 5 parameters

  • lowlarge method
    custom_components/openwrt/config_flow.py:2499

    async_step_options_permissions is 62 lines long

  • lowlarge method
    custom_components/openwrt/config_flow.py:2405

    async_step_options_select_devices is 63 lines long

  • lowbumpy road
    custom_components/openwrt/config_flow.py:2499

    async_step_options_permissions has 3 nested blocks at the same level (bumpy road)

  • lowbumpy road
    custom_components/openwrt/config_flow.py:2405

    async_step_options_select_devices has 3 nested blocks at the same level (bumpy road)

Resolved (3)
  • function hotspot
    custom_components/openwrt/helpers/mqtt_presence.py
  • complex method
    custom_components/openwrt/config_flow.py
  • brain method
    custom_components/openwrt/config_flow.py

Who else knows this code

The primary author of each changed file by share of its recent commits, mined from git history. Advisory: it says who has context, not who must review.

  • custom_components/openwrt/helpers/mqtt_presence.pyFabian Seitz 100% of 1 commits
  • custom_components/openwrt/coordinator.pyFabian Seitz 63% of 52 commits
  • custom_components/openwrt/config_flow.pyFabian Seitz 88% of 16 commits
  • tests/test_mqtt_presence.pyFabian Seitz 80% of 6 commits
  • custom_components/openwrt/const.pyFabian Seitz 92% of 8 commits

Tests that cover this change

Test files that import a file this PR changes. Not a coverage measurement: it is the import graph, so it says which tests are worth running, not which lines they reach.

  • tests/test_api_capability_probing.py
  • tests/test_backup_download.py
  • tests/test_button.py
  • tests/test_config_flow.py
  • tests/test_config_flow_error_handling.py
  • tests/test_backoff.py
  • tests/test_coordinator.py
  • tests/test_feature_availability.py

2 changed files have no test importing them.

Get this on your own pull requests

This page came from an index of FaserF/ha-openwrt. No model calls, no configuration, and it refreshes on every push. Install the bot and every pull request gets one of these.