Skip to content

Commit 460fa6e

Browse files
committed
fix device classes [#46]
2024.10.0
1 parent 95dba4d commit 460fa6e

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

custom_components/tibber_local/const.py

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
from typing import Final
21
from dataclasses import dataclass
2+
from typing import Final
33

44
from homeassistant.components.sensor import (
55
SensorDeviceClass,
66
SensorEntityDescription,
77
SensorStateClass,
88
)
9-
109
from homeassistant.const import (
1110
UnitOfElectricPotential,
1211
UnitOfElectricCurrent,
@@ -15,7 +14,6 @@
1514
UnitOfPower,
1615
DEGREE,
1716
)
18-
from homeassistant.helpers.entity import EntityCategory
1917

2018
DOMAIN: Final = "tibber_local"
2119
MANUFACTURE: Final = "Tibber"
@@ -133,7 +131,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
133131
name="Potential L1",
134132
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
135133
icon="mdi:lightning-bolt",
136-
device_class=SensorDeviceClass.ENERGY,
134+
device_class=SensorDeviceClass.VOLTAGE,
137135
state_class=SensorStateClass.MEASUREMENT,
138136
),
139137
# Spannung L2
@@ -142,7 +140,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
142140
name="Potential L2",
143141
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
144142
icon="mdi:lightning-bolt",
145-
device_class=SensorDeviceClass.ENERGY,
143+
device_class=SensorDeviceClass.VOLTAGE,
146144
state_class=SensorStateClass.MEASUREMENT,
147145
),
148146
# Spannung L3
@@ -151,7 +149,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
151149
name="Potential L3",
152150
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
153151
icon="mdi:lightning-bolt",
154-
device_class=SensorDeviceClass.ENERGY,
152+
device_class=SensorDeviceClass.VOLTAGE,
155153
state_class=SensorStateClass.MEASUREMENT,
156154
),
157155

@@ -161,7 +159,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
161159
name="Current L1",
162160
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
163161
icon="mdi:current-ac",
164-
device_class=SensorDeviceClass.ENERGY,
162+
device_class=SensorDeviceClass.CURRENT,
165163
state_class=SensorStateClass.MEASUREMENT,
166164
),
167165
# Strom L2
@@ -170,7 +168,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
170168
name="Current L2",
171169
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
172170
icon="mdi:current-ac",
173-
device_class=SensorDeviceClass.ENERGY,
171+
device_class=SensorDeviceClass.CURRENT,
174172
state_class=SensorStateClass.MEASUREMENT,
175173
),
176174
# Strom L3
@@ -179,7 +177,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
179177
name="Current L3",
180178
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
181179
icon="mdi:current-ac",
182-
device_class=SensorDeviceClass.ENERGY,
180+
device_class=SensorDeviceClass.CURRENT,
183181
state_class=SensorStateClass.MEASUREMENT,
184182
),
185183

@@ -200,7 +198,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
200198
suggested_display_precision=1,
201199
native_unit_of_measurement=DEGREE,
202200
icon="mdi:sine-wave",
203-
device_class=SensorDeviceClass.POWER,
201+
device_class=None,
204202
state_class=SensorStateClass.MEASUREMENT,
205203
),
206204
# Phasenabweichung Spannungen L1/L3
@@ -210,7 +208,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
210208
suggested_display_precision=1,
211209
native_unit_of_measurement=DEGREE,
212210
icon="mdi:sine-wave",
213-
device_class=SensorDeviceClass.POWER,
211+
device_class=None,
214212
state_class=SensorStateClass.MEASUREMENT,
215213
),
216214

@@ -221,7 +219,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
221219
suggested_display_precision=1,
222220
native_unit_of_measurement=DEGREE,
223221
icon="mdi:sine-wave",
224-
device_class=SensorDeviceClass.ENERGY,
222+
device_class=None,
225223
state_class=SensorStateClass.MEASUREMENT,
226224
),
227225
# Phasenabweichung Strom/Spannung L2
@@ -231,7 +229,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
231229
suggested_display_precision=1,
232230
native_unit_of_measurement=DEGREE,
233231
icon="mdi:sine-wave",
234-
device_class=SensorDeviceClass.ENERGY,
232+
device_class=None,
235233
state_class=SensorStateClass.MEASUREMENT,
236234
),
237235
# Phasenabweichung Strom/Spannung L3
@@ -241,7 +239,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
241239
suggested_display_precision=1,
242240
native_unit_of_measurement=DEGREE,
243241
icon="mdi:sine-wave",
244-
device_class=SensorDeviceClass.ENERGY,
242+
device_class=None,
245243
state_class=SensorStateClass.MEASUREMENT,
246244
),
247245
]

custom_components/tibber_local/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"iot_class": "local_polling",
1111
"issue_tracker": "https://github.com/marq24/ha-tibber-pulse-local/issues",
1212
"requirements": ["smllib==1.4"],
13-
"version": "2024.9.0"
13+
"version": "2024.10.0"
1414
}

0 commit comments

Comments
 (0)