Skip to content

fix(coordinator): 🐛 stop hiding heating/cooling devices before first use#671

Merged
rhammen merged 1 commit into
mainfrom
fix/device-not-detected-without-usage-hours
Jul 4, 2026
Merged

fix(coordinator): 🐛 stop hiding heating/cooling devices before first use#671
rhammen merged 1 commit into
mainfrom
fix/device-not-detected-without-usage-hours

Conversation

@rhammen

@rhammen rhammen commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

🐛 Problem

Reported in #655: on a freshly commissioned system, the heating and cooling devices (and every entity under them) were missing entirely, even though DHW showed up fine.

Cause: has_heating/has_cooling gated the entire device on cumulative operating hours reported by the heat pump (> 0). If a mode simply hadn't run yet — e.g. heating/cooling never activated on a newly poured floor, or cooling checked outside the season — its device was hidden instead of just showing zeroed-out sensors. DHW only worked for the reporter by coincidence, since it had already accumulated hours.

✅ Fix

  • Heating: now always creates the device, the same way the heatpump device is always created. Every supported Luxtronik heat pump can heat, so there isn't a meaningful "not present" case here — removed the now-dead has_heating property.
  • Cooling: creates the device if usage hours are > 0 or detect_cooling_present() says a mixing circuit is configured for cooling/heating_cooling. This reuses the existing, already-trusted MK-based detection (previously only used for per-entity visibility of V0005_COOLING), so cooling shows up as soon as it's configured rather than after it's actually run once.
  • Domestic water is intentionally left unchanged — DHW is used year-round (not seasonal like heating/cooling), so a system with 0 DHW hours self-corrects within days. We'll only revisit it if it turns out to be a real problem in practice.

🧪 Test plan

  • Added test_heating_always_active_without_usage_hours (heating device active even with 0 hours)
  • Added test_cooling_active_without_usage_hours_when_configured (cooling device active with 0 hours but MK1 configured as cooling)
  • pytest — 747 passed, 100% coverage maintained
  • ruff check / ruff format --check — clean
  • basedpyright — 0 errors

Resolves #655

- always create the heating device, matching the heatpump device
- create the cooling device if either usage hours are > 0 or a mixing
  circuit is configured for cooling/heating_cooling
  (detect_cooling_present())
- remove the now-unused has_heating property

Previously has_heating/has_cooling only looked at cumulative operating
hours, so a freshly commissioned system (or one where a mode simply
hasn't run yet, e.g. off-season cooling) would have its whole device
hidden instead of just showing zeroed sensors. Heating is treated as
always present since every supported Luxtronik heat pump can heat;
cooling capability is inferred from its mixing-circuit configuration,
which does not depend on runtime.

Resolves #655
@rhammen rhammen merged commit db466d7 into main Jul 4, 2026
9 checks passed
@rhammen rhammen deleted the fix/device-not-detected-without-usage-hours branch July 4, 2026 12:52
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.

Not all sensors and controls appear

1 participant