Skip to content

Commit 8957283

Browse files
committed
fix: Use StatisticMeanType Enum
1 parent 4d9de1a commit 8957283

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

custom_components/electric_ireland_insights/sensor_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from datetime import datetime, timedelta, UTC
77
from typing import List
88

9-
from homeassistant.components.recorder.models import StatisticData, StatisticMetaData
9+
from homeassistant.components.recorder.models import StatisticData, StatisticMetaData, StatisticMeanType
1010
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
1111

1212
from homeassistant_historical_sensor import (
@@ -141,8 +141,7 @@ def get_statistic_metadata(self) -> StatisticMetaData:
141141
#
142142
meta = super().get_statistic_metadata()
143143
meta["has_sum"] = True
144-
meta["has_mean"] = True
145-
meta["mean_type"] = "arithmetic"
144+
meta["mean_type"] = StatisticMeanType.ARITHMETIC
146145

147146
return meta
148147

hacs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "Electric Ireland Insights for Home Assistant",
33
"country": "IE",
44
"zip_release": false,
5-
"homeassistant": "2024.1.0",
5+
"homeassistant": "2025.4.0",
66
"hacs": "2.0.0"
77
}

0 commit comments

Comments
 (0)