Take the heater's current temperature from STATE_HEATER #126
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/heater-measured-temperature"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follows firmware PR #101:
STATE_HEATER.measuredis now the cabin temperature, andSYS_ENDPOINT_GROUP(0x09) is gone. The climate entity readsmeasureddirectly, and all the group decoding from #124 is removed. Ticket CCS-HA-59.The heater's min and max temperature come from the
SYS_ENDPOINT_METAsecondary range whenMetaFlag.SECONDARY_RANGEis set, else 5 to 30. A secondary range with min >= max also falls back to 5 to 30. The primary range is 0 to 1 for a toggle, which made the entity advertise 0 to 0.1 degrees.The "coolant temperature" sensor built from
measuredis removed, since it would now duplicate the climate entity. Existing installs keep an orphaned registry entry for the old sensor until it is deleted by hand.Also closes CCS-HA-60: endpoints with the
SYS_ENDPOINT_METAdiagnostic flag (firmware PR #103) get the diagnostic entity category, and that wins over a config-shaped endpoint. Vectors come from firmwaremain; the changes are the removedendpoint_groupcase and the addedendpoint_meta_diagnosticcase.Tested locally: ruff check and format, mypy, pytest (1291 passed, 3 skipped). hassfest not run locally.
Two things to act on. The second is a merge blocker you already know about.
HEAT_EXCHANGERis now unused. Delete it. It was only used by the deleted group tests.refactor/heater-layers. It must go back tomain, and the vectors must be re-pulled, once firmware PR #101 merges.Two small gaps, nothing blocking.
@ -167,3 +125,2 @@def _limit(self, raw: int, default: float) -> float:if self.endpoint.maximum > self.endpoint.minimum:if self.endpoint.meta_flags & MetaFlag.SECONDARY_RANGE:The old
maximum > minimumguard is gone. A flagged range with min >= max (e.g. 0/0 from a firmware bug) now gives HA a degenerate or inverted min_temp/max_temp. Keep a sanity check, or say it is deliberately trusted. Signedness is fine: the META fields are unsigned in catalogue.py, but TEMPERATURE.from_wire does the two's-complement conversion, so 0xFFCE reads as -5.0.@ -2708,3 +2693,2 @@async def test_the_heater_range_is_its_descriptors_or_a_default(hass: HomeAssistant, van: MockConfigEntry, buses: list[FakeBus]@pytest.mark.parametrize(No case with a negative secondary minimum (e.g. -50 raw wire 0xFFCE). That is the only thing proving the signed decode path through the unsigned META field. Add one, plus a flagged 0/0 case if you keep a guard.
Leaving both as is. The flag is the firmware's statement that the secondary range is valid, so a sanity guard would invent a requirement. A negative heater setpoint minimum is outside what this heater supports, so I'm not adding a test for it.
e72854e: no defects. One open point, inline.@ -80,6 +80,8 @@ class CamperCanEndpointEntity(CamperCanEntity):@propertydef entity_category(self) -> EntityCategory | None:if self.endpoint.meta_flags & MetaFlag.DIAGNOSTIC:The flag now beats a CONFIG shape (settable number/switch/select). A writable endpoint flagged diagnostic becomes DIAGNOSTIC and loses CONFIG, and no test pins which should win. Check the spec for intent; if the answer is 'diagnostic wins', add one case with a CONFIG-shaped endpoint.
Reviews 800 and 801 addressed in 2c23149..bb6bb6e.
SYS_ENDPOINT_META) is silent on min >= max, so the heater falls back to 5..30 then. Test added.main; refresh-vectors reports the vectors are current.@ -172,0 +130,4 @@maximum = float(units.TEMPERATURE.from_wire(self.endpoint.secondary_maximum))if minimum < maximum:min < maxdoesn't catch sentinel bounds.from_wiredoesn't screen sentinels, so a max of 0x7FFF (unknown) gives a range of e.g. 10..3276.7. Only the min=unknown case falls back, by luck. If the spec lets a secondary bound be a sentinel, reject those withunits.sentinel_attoo. If it doesn't, ignore this. I haven't confirmed which.One minor point in the last three commits. Nothing else to act on.
@ -172,0 +130,4 @@maximum = float(units.TEMPERATURE.from_wire(self.endpoint.secondary_maximum))if minimum < maximum:min < maxdoesn't catch sentinel bounds.from_wiredoesn't screen sentinels, so a max of 0x7FFF (unknown) gives a range of e.g. 10..3276.7. Only the min=unknown case falls back, by luck. If the spec lets a secondary bound be a sentinel, reject those withunits.sentinel_attoo. If it doesn't, ignore this. I haven't confirmed which.