Skip to content

Commit e6fffa7

Browse files
committed
Document internal purpose of per-device boost provenance field
1 parent b6fe6b3 commit e6fffa7

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

custom_components/thermosmart/coordinator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,14 @@ async def _async_update_data(self) -> dict:
11451145
# (conservative zone truth; absorbs clamp/step reduction).
11461146
# partial/failed → 0.0 public; per-device offsets preserved for provenance.
11471147
# not_attempted → 0.0 (approved-but-not-dispatched must not appear as applied; lifecycle not touched).
1148+
#
1149+
# recommendation["_boost_per_device_applied_c"] (set in all three branches
1150+
# below) is internal provenance, not part of the public/exported
1151+
# diagnostics surface — no entity, export, or ha_integration.py code reads
1152+
# it. Its purpose is to let the private boost test suite verify the
1153+
# conservative-minimum derivation above (applied_boost_offset_c must never
1154+
# exceed any individual device's own offset) without duplicating this
1155+
# per-device counterfactual computation in test code.
11481156
if self._learning_shadow is not None and bool(recommendation.get("learning_boost_adjusted")):
11491157
_baseline_c = float(recommendation.get("tpi_baseline_setpoint") or 0.0)
11501158
_eff_by_eid = _sp_stats.effective_setpoints_by_entity

0 commit comments

Comments
 (0)