fix(coordinator): 🐛 stop hiding heating/cooling devices before first use#671
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 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_coolinggated 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
heatpumpdevice is always created. Every supported Luxtronik heat pump can heat, so there isn't a meaningful "not present" case here — removed the now-deadhas_heatingproperty.> 0ordetect_cooling_present()says a mixing circuit is configured forcooling/heating_cooling. This reuses the existing, already-trusted MK-based detection (previously only used for per-entity visibility ofV0005_COOLING), so cooling shows up as soon as it's configured rather than after it's actually run once.🧪 Test plan
test_heating_always_active_without_usage_hours(heating device active even with 0 hours)test_cooling_active_without_usage_hours_when_configured(cooling device active with 0 hours but MK1 configured as cooling)pytest— 747 passed, 100% coverage maintainedruff check/ruff format --check— cleanbasedpyright— 0 errorsResolves #655