From 0b29a21b338c24620885547522e72fcbd0f81ef3 Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Tue, 27 Aug 2024 12:52:01 +0000 Subject: [PATCH] Add current intraday price ranking to Tibber price sensor --- homeassistant/components/tibber/sensor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/tibber/sensor.py b/homeassistant/components/tibber/sensor.py index d6f8baa931c7a4..09b36f4192972e 100644 --- a/homeassistant/components/tibber/sensor.py +++ b/homeassistant/components/tibber/sensor.py @@ -383,6 +383,7 @@ def __init__(self, tibber_home: tibber.TibberHome) -> None: "off_peak_1": None, "peak": None, "off_peak_2": None, + "intraday_price_ranking": None, } self._attr_icon = ICON self._attr_unique_id = self._tibber_home.home_id @@ -411,8 +412,9 @@ async def async_update(self) -> None: return res = self._tibber_home.current_price_data() - self._attr_native_value, price_level, self._last_updated, _ = res + self._attr_native_value, price_level, self._last_updated, price_rank = res self._attr_extra_state_attributes["price_level"] = price_level + self._attr_extra_state_attributes["intraday_price_ranking"] = price_rank attrs = self._tibber_home.current_attributes() self._attr_extra_state_attributes.update(attrs)