1
- from typing import Final
2
1
from dataclasses import dataclass
2
+ from typing import Final
3
3
4
4
from homeassistant .components .sensor import (
5
5
SensorDeviceClass ,
6
6
SensorEntityDescription ,
7
7
SensorStateClass ,
8
8
)
9
-
10
9
from homeassistant .const import (
11
10
UnitOfElectricPotential ,
12
11
UnitOfElectricCurrent ,
15
14
UnitOfPower ,
16
15
DEGREE ,
17
16
)
18
- from homeassistant .helpers .entity import EntityCategory
19
17
20
18
DOMAIN : Final = "tibber_local"
21
19
MANUFACTURE : Final = "Tibber"
@@ -133,7 +131,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
133
131
name = "Potential L1" ,
134
132
native_unit_of_measurement = UnitOfElectricPotential .VOLT ,
135
133
icon = "mdi:lightning-bolt" ,
136
- device_class = SensorDeviceClass .ENERGY ,
134
+ device_class = SensorDeviceClass .VOLTAGE ,
137
135
state_class = SensorStateClass .MEASUREMENT ,
138
136
),
139
137
# Spannung L2
@@ -142,7 +140,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
142
140
name = "Potential L2" ,
143
141
native_unit_of_measurement = UnitOfElectricPotential .VOLT ,
144
142
icon = "mdi:lightning-bolt" ,
145
- device_class = SensorDeviceClass .ENERGY ,
143
+ device_class = SensorDeviceClass .VOLTAGE ,
146
144
state_class = SensorStateClass .MEASUREMENT ,
147
145
),
148
146
# Spannung L3
@@ -151,7 +149,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
151
149
name = "Potential L3" ,
152
150
native_unit_of_measurement = UnitOfElectricPotential .VOLT ,
153
151
icon = "mdi:lightning-bolt" ,
154
- device_class = SensorDeviceClass .ENERGY ,
152
+ device_class = SensorDeviceClass .VOLTAGE ,
155
153
state_class = SensorStateClass .MEASUREMENT ,
156
154
),
157
155
@@ -161,7 +159,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
161
159
name = "Current L1" ,
162
160
native_unit_of_measurement = UnitOfElectricCurrent .AMPERE ,
163
161
icon = "mdi:current-ac" ,
164
- device_class = SensorDeviceClass .ENERGY ,
162
+ device_class = SensorDeviceClass .CURRENT ,
165
163
state_class = SensorStateClass .MEASUREMENT ,
166
164
),
167
165
# Strom L2
@@ -170,7 +168,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
170
168
name = "Current L2" ,
171
169
native_unit_of_measurement = UnitOfElectricCurrent .AMPERE ,
172
170
icon = "mdi:current-ac" ,
173
- device_class = SensorDeviceClass .ENERGY ,
171
+ device_class = SensorDeviceClass .CURRENT ,
174
172
state_class = SensorStateClass .MEASUREMENT ,
175
173
),
176
174
# Strom L3
@@ -179,7 +177,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
179
177
name = "Current L3" ,
180
178
native_unit_of_measurement = UnitOfElectricCurrent .AMPERE ,
181
179
icon = "mdi:current-ac" ,
182
- device_class = SensorDeviceClass .ENERGY ,
180
+ device_class = SensorDeviceClass .CURRENT ,
183
181
state_class = SensorStateClass .MEASUREMENT ,
184
182
),
185
183
@@ -200,7 +198,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
200
198
suggested_display_precision = 1 ,
201
199
native_unit_of_measurement = DEGREE ,
202
200
icon = "mdi:sine-wave" ,
203
- device_class = SensorDeviceClass . POWER ,
201
+ device_class = None ,
204
202
state_class = SensorStateClass .MEASUREMENT ,
205
203
),
206
204
# Phasenabweichung Spannungen L1/L3
@@ -210,7 +208,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
210
208
suggested_display_precision = 1 ,
211
209
native_unit_of_measurement = DEGREE ,
212
210
icon = "mdi:sine-wave" ,
213
- device_class = SensorDeviceClass . POWER ,
211
+ device_class = None ,
214
212
state_class = SensorStateClass .MEASUREMENT ,
215
213
),
216
214
@@ -221,7 +219,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
221
219
suggested_display_precision = 1 ,
222
220
native_unit_of_measurement = DEGREE ,
223
221
icon = "mdi:sine-wave" ,
224
- device_class = SensorDeviceClass . ENERGY ,
222
+ device_class = None ,
225
223
state_class = SensorStateClass .MEASUREMENT ,
226
224
),
227
225
# Phasenabweichung Strom/Spannung L2
@@ -231,7 +229,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
231
229
suggested_display_precision = 1 ,
232
230
native_unit_of_measurement = DEGREE ,
233
231
icon = "mdi:sine-wave" ,
234
- device_class = SensorDeviceClass . ENERGY ,
232
+ device_class = None ,
235
233
state_class = SensorStateClass .MEASUREMENT ,
236
234
),
237
235
# Phasenabweichung Strom/Spannung L3
@@ -241,7 +239,7 @@ class ExtSensorEntityDescription(SensorEntityDescription):
241
239
suggested_display_precision = 1 ,
242
240
native_unit_of_measurement = DEGREE ,
243
241
icon = "mdi:sine-wave" ,
244
- device_class = SensorDeviceClass . ENERGY ,
242
+ device_class = None ,
245
243
state_class = SensorStateClass .MEASUREMENT ,
246
244
),
247
245
]
0 commit comments