Skip to content

chore(lux_overrides): 🔧 adopt upstream datatypes for the Mk3 timer block, limit temperatures and counters - #804

Merged
rhammen merged 5 commits into
mainfrom
chore/upstream-datatypes-mk3-celsius
Sep 16, 2026
Merged

rhammen merged 5 commits into
mainfrom
chore/upstream-datatypes-mk3-celsius

Conversation

@rhammen

@rhammen rhammen commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

🔍 What this fixes

A diff of the datatypes we run (python-luxtronik 0.3.14 + lux_overrides) against upstream python-luxtronik main turned up a handful of registers upstream has typed that we still carry as Unknown. The ones here are confirmed by the local diagnostics corpus (30 heat pumps) and have no reader in the integration, so the change is limited to how diagnostics dumps render them — nothing user-visible. Follow-up to #789's TimeOfDay2 work; the entity-facing candidates (last defrost → #803, refrigerant temperatures / compressor frequency limits) are handled separately.

✨ Changes

All in custom_components/luxtronik2/lux_overrides.py / update_Luxtronik_Parameters:

  • Mixing circuit 3 timer block — 788 ID_Einst_SuMk3_akt2 joins the TimerProgram selectors, 789–848 (SuMk3Wo/25/Tg) the TimeOfDay range. The override stopped at 667 and missed this block entirely. Corpus: 789/790 hold 34200/61200 and 18000/79200 (09:30–17:00, 05:00–22:00) on two units, one time per register — the same shape as the other circuits, not the packed ventilation layout.
  • Six limit temperatures — 84 TLG_max, 87 TRBegr, 91 TAmax, 92 TAmin, 94 THGmax, 96 TV2VDBW join the Celsius bulk list. All 30 units store plausible tenths (84 at 650–700, 87 at 350–650, 91 at 350–450, 92 at −200/−220, 94 at 1150–1400, 96 at 500 everywhere).
  • Operating-time counters — 668–673, 728–730, 859 (ID_Zaehler_BetrZeit*), the parameter-side mirrors of calculations 56–66, get the library's Seconds.
  • Heat-quantity date — 880 ID_Waermemenge_Datum gets the library's Timestamp (eight units on the 2018‑01‑01 factory default, eight on 0 → 1970‑01‑01, as 6/7/731/732 already render).

Verified: no LuxParameter member, visibility gate, factor= or select map reads any of these registers, so the #773/#777 failure mode (a datatype change silently changing a reader) does not apply. No overlap with parameters_to_add_update or the Kelvin list.

🧪 Tests

tests/test_lux_overrides.py: names, classes and a corpus conversion for every register; both ends of the Mk3 block locked (787 and 849 untyped); 880's default pinned timezone-independently. Full run: 1276 passed, 1 skipped, coverage 100 % (unchanged); ruff check/format, basedpyright (0), codespell clean. Independently code-reviewed; findings applied.

Note for merging: this touches the same schedule_numbers hunk as fix/789-ventilation-slot-registers; whichever lands second gets a small, mechanical conflict (keep #789's structure, add range(788, 849) to its TimeOfDay list and 788 to timer_program_numbers).

🤖 Generated with Claude Code

rhammen and others added 5 commits September 16, 2026 19:42
…atures

- Mixing circuit 3 sits apart from the 162-667 run: 788 is its program
  selector and 789-848 its WO/25/TG time block, the same shape as the
  other circuits; the override stopped at 667 and left the whole block
  Unknown. Two corpus units carry 34200 / 18000 (09:30 / 05:00) in 789
- 84, 87, 91, 92, 94, 96 (TLG_max, TRBegr, TAmax, TAmin, THGmax,
  TV2VDBW) join the Celsius bulk list: every unit in the diagnostics
  corpus stores them as tenths (700, 560, 350, -200, 1150, 500)
- Both match the types upstream python-luxtronik main assigns; nothing
  in the integration reads these registers yet, so this only changes
  how diagnostics render them

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ntity date

- 668-673, 728-730 and 859 (ID_Zaehler_BetrZeit*) are the parameter-side
  mirrors of the operating-time calculations 56-66 and count seconds;
  they now carry the library's Seconds datatype
- 880 ID_Waermemenge_Datum is a Unix timestamp; eight corpus units sit
  on its 2018-01-01 factory default
- Both match upstream python-luxtronik main; nothing in the integration
  reads these registers, so this only changes how diagnostics render them

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- The six Celsius limit temperatures are not uniform across the corpus
  (84 at 650-700, 87 at 350-650, 91 at 350-450, 92 at -200/-220, 94 at
  1150-1400, only 96 at 500 everywhere); the comment and test docstring
  now say so instead of quoting one value per register
- Note that 880 reads 0 on eight units, which the library's Timestamp
  renders as 1970-01-01, the same as parameters 6/7/731/732
- Lock both ends of the Mk3 block (787 and 849) in the coverage test and
  pin the 2018-01-01 default of 880 tz-independently

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…pes-mk3-celsius

# Conflicts:
#	custom_components/luxtronik2/lux_overrides.py
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
custom_components.luxtronik2 100% ✔
Summary 100% (3882 / 3882) ✔

@rhammen
rhammen merged commit ee6dfc0 into main Sep 16, 2026
8 checks passed
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.

1 participant