Skip to content

test(heating): align F461 season frame assertion with WHO 4 season contract - #120

Merged
GreenGrassBlueOcean merged 1 commit into
OpenWebNet-HA:masterfrom
GreenGrassBlueOcean:fix/f461-season-frame-assertion
Oct 16, 2026
Merged

GreenGrassBlueOcean merged 1 commit into
OpenWebNet-HA:masterfrom
GreenGrassBlueOcean:fix/f461-season-frame-assertion

Conversation

@GreenGrassBlueOcean

@GreenGrassBlueOcean GreenGrassBlueOcean commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What is the problem

Immediately after merging PR #97 (feat/who4-consolidated-heating, commit 6af9377) into master, CI failed across all Python matrix versions (3.11, 3.12, 3.13, 3.14) on run #395.

The root cause was a semantic merge conflict between two PRs merged back-to-back:

  1. PR fix(heating,gateway): dimension 19 is_active, plain protection form and device type 200 from a live F461 capture #116 (fix/f461-live-plant, commit 278c732) added tests/test_f461_live_plant.py containing:
    def test_season_frames_and_area_zero_lights_parse_as_before() -> None:
        assert OWNEvent.parse("*4*1*2##").mode == "heat" and OWNEvent.parse("*4*0*2##").mode == "cool"
  2. PR fix(heating): correct season status, holiday programs, and CU diagnostics (#87, #88, #89, #94) #97 (feat/who4-consolidated-heating, commit 6af9377) merged directly afterward without rebasing onto PR fix(heating,gateway): dimension 19 is_active, plain protection form and device type 200 from a live F461 capture #116. PR fix(heating): correct season status, holiday programs, and CU diagnostics (#87, #88, #89, #94) #97 aligned WHO 4 bare WHAT 0 / 1 frames (*4*0*Z##, *4*1*Z##) with the Legrand WHO 4 specification ("zone operation mode acquire frame", p. 5, 13, 16, 19, 63): these frames report the current zone/plant season (season == "heating" or "conditioning", message_type == "hvac_season", mode is None), rather than an operating mode change (mode == "heat" / "cool"). Because test_f461_live_plant.py still asserted the obsolete pre-fix(heating): correct season status, holiday programs, and CU diagnostics (#87, #88, #89, #94) #97 .mode attribute, it failed with AssertionError: assert (None == 'heat').

Additionally, OWNd/message/door_entry.py (added in PR #109) was missing an entry in COMPONENT_NOTES in scripts/sync_documentation.py and the README.md coverage table, which caused the documentation anti-drift sentinel tests (test_sync_documentation_live_readme and test_main_cli_modes) to fail whenever coverage.xml was present in the repository root.


How is it solved

  1. Align F461 season test with WHO 4 season contract:
    Updated tests/test_f461_live_plant.py::test_season_frames_and_area_zero_lights_parse_as_before to assert .season instead of .mode:
    def test_season_frames_and_area_zero_lights_parse_as_before() -> None:
        assert OWNEvent.parse("*4*1*2##").season == "heating" and OWNEvent.parse("*4*0*2##").season == "conditioning"
  2. Register Door Entry in documentation sentinel:
    Added "OWNd/message/door_entry.py": "WHO 6 & WHO 8: Door entry, lock, and video intercom events and commands" to COMPONENT_NOTES in scripts/sync_documentation.py and regenerated the coverage table in README.md.

How is it tested

  • Pytest Suite: Executed in WSL Ubuntu with core Python 3.14 test harness:
    python -m pytest -q -p pytest_cov --cov=OWNd --cov-report=xml --cov-report=term-missing
    Result: 1,489 passed (0 failed, 1 skipped) across all test suites, including:
    • tests/test_f461_live_plant.py
    • tests/test_who4_season.py
    • tests/test_firmware_contract.py
    • tests/test_sync_documentation.py
  • Coverage Verification: Verified strict 100.0% statement coverage across all 25 modules:
    python scripts/verify_coverage.py coverage.xml 80.0
    Result: 4,811 / 4,811 statements covered (100.0% overall).
  • Static Analysis & Linters:
    • ruff check OWNd tests setup.py scripts (all clean)
    • mypy OWNd tests/typing (success, 27 source files checked)
    • python scripts/verify_library_standards.py (all library standards passed)
    • python scripts/sync_documentation.py --check (0 drift, fully synchronized)

Where are the traces

  1. F461 Live Plant Trace:

    • Inlined directly in the test suite at tests/test_f461_live_plant.py:
      • GATEWAY_FRAMES (lines 30–66): The full capture of distinct frames sent by the physical BTicino F461 gateway (firmware 2.0.11), captured 2026-10-15.
      • Specifically lines 55–56:
        "*#4*2*0*0241##", "*#4*2*12*0245*3##", "*4*1*2##", "*#4*2*14*0245*3##", "*#4*2*13*00##",
        "*#4*2*0*0243##", "*4*0*2##", "*4*303*2##", "*4*202*2##",
        showing *4*1*2## (heating season) and *4*0*2## (conditioning season) in the live 5-frame status response to *#4*2##.
      • EVENTS_AFTER (lines 84–95): Shows event sessions reacting to commands (*4*1*2## and *4*0*2##).
    • The original multi-session raw bus capture archive is stored in the MyHOME repository trace corpus under OpenWebNet-HA/MyHOME PR #714.
  2. WHO 4 Firmware Contracts & Oracles:

    • tests/oracle/who4_facts.json: 1,745 decoded facts extracted from gateway firmware execution (F453AV, F454, MyHomeServer1) verifying WHO 4 season acquisition and status frames.
    • tests/test_who4_season.py: Protocol specifications validating WHAT 0 / 1 zone operation mode against Legrand WHO 4 v2.0.0 documentation and libqtdevices (probe_device.cpp:240-253).

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fedem95 fedem95 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.

This aligns the F461 season-frame assertion with the WHO 4 season contract and fixes the documentation sync entry for door_entry. The changes are focused, and the visible CI jobs pass.

@GreenGrassBlueOcean
GreenGrassBlueOcean merged commit 9f8ea79 into OpenWebNet-HA:master Oct 16, 2026
8 checks passed
@GreenGrassBlueOcean
GreenGrassBlueOcean deleted the fix/f461-season-frame-assertion branch October 16, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants