fix: Update trend percentage attribute key format in TibberPricesSensor

This commit is contained in:
Julian Pawlowski 2025-11-07 14:49:36 +00:00
parent 19063daa72
commit f4ae8422f2

View file

@ -1200,7 +1200,7 @@ class TibberPricesSensor(TibberPricesEntity, SensorEntity):
# Core attributes # Core attributes
self._attr_extra_state_attributes["timestamp"] = next_interval_start.isoformat() self._attr_extra_state_attributes["timestamp"] = next_interval_start.isoformat()
self._attr_extra_state_attributes[f"trend_{hours}h_percentage"] = round(diff_pct, 1) self._attr_extra_state_attributes[f"trend_{hours}h_%"] = round(diff_pct, 1)
self._attr_extra_state_attributes[f"future_avg_{hours}h"] = round(future_avg * 100, 2) self._attr_extra_state_attributes[f"future_avg_{hours}h"] = round(future_avg * 100, 2)
self._attr_extra_state_attributes["intervals_analyzed"] = hours * 4 self._attr_extra_state_attributes["intervals_analyzed"] = hours * 4