diff --git a/custom_components/tibber_prices/sensor/calculators/rolling_hour.py b/custom_components/tibber_prices/sensor/calculators/rolling_hour.py index 10ed65a..6e26078 100644 --- a/custom_components/tibber_prices/sensor/calculators/rolling_hour.py +++ b/custom_components/tibber_prices/sensor/calculators/rolling_hour.py @@ -112,7 +112,7 @@ class TibberPricesRollingHourCalculator(TibberPricesBaseCalculator): # Map other value types to aggregation functions aggregators = { - "level": lambda data: aggregate_level_data(data), + "level": aggregate_level_data, "rating": lambda data: aggregate_rating_data(data, threshold_low, threshold_high), } diff --git a/custom_components/tibber_prices/sensor/helpers.py b/custom_components/tibber_prices/sensor/helpers.py index 6488a23..b06dca9 100644 --- a/custom_components/tibber_prices/sensor/helpers.py +++ b/custom_components/tibber_prices/sensor/helpers.py @@ -136,7 +136,7 @@ def aggregate_window_data( # Map value types to aggregation functions aggregators: dict[str, Callable] = { "price": lambda data: aggregate_average_data(data, config_entry)[0], # Use only average from tuple - "level": lambda data: aggregate_level_data(data), + "level": aggregate_level_data, "rating": lambda data: aggregate_rating_data(data, threshold_low, threshold_high), } diff --git a/custom_components/tibber_prices/sensor/value_getters.py b/custom_components/tibber_prices/sensor/value_getters.py index f7d3625..4375bc8 100644 --- a/custom_components/tibber_prices/sensor/value_getters.py +++ b/custom_components/tibber_prices/sensor/value_getters.py @@ -217,7 +217,7 @@ def get_value_getter_mapping( # noqa: PLR0913 - needs all calculators as parame # Diagnostic sensors "data_timestamp": get_data_timestamp, # Data lifecycle status sensor - "data_lifecycle_status": lambda: lifecycle_calculator.get_lifecycle_state(), + "data_lifecycle_status": lifecycle_calculator.get_lifecycle_state, # Home metadata sensors (via MetadataCalculator) "home_type": lambda: metadata_calculator.get_home_metadata_value("type"), "home_size": lambda: metadata_calculator.get_home_metadata_value("size"),