Commit 1afcbd2 committed Dec 27, 2024 · 1 / 1
1 parent 1ee4199 commit 1afcbd2 Copy full SHA for 1afcbd2
File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 11
11
"requirements" : [" pyeldom==0.4.1" ],
12
12
"ssdp" : [],
13
13
"zeroconf" : [],
14
- "version" : " 3.1.2 "
14
+ "version" : " 3.2.0 "
15
15
}
Original file line number Diff line number Diff line change 2
2
3
3
import logging
4
4
5
- from homeassistant .components .sensor import SensorDeviceClass , SensorEntity
5
+ from homeassistant .components .sensor import (
6
+ SensorDeviceClass ,
7
+ SensorEntity ,
8
+ SensorStateClass ,
9
+ )
6
10
from homeassistant .config_entries import ConfigEntry
7
11
from homeassistant .const import UnitOfEnergy
8
12
from homeassistant .core import HomeAssistant , callback
@@ -120,6 +124,11 @@ def device_class(self) -> SensorDeviceClass:
120
124
"""Return the device class of the sensor."""
121
125
return SensorDeviceClass .ENERGY
122
126
127
+ @property
128
+ def state_class (self ) -> SensorStateClass :
129
+ """Return the state class of the sensor."""
130
+ return SensorStateClass .TOTAL_INCREASING
131
+
123
132
@property
124
133
def native_unit_of_measurement (self ) -> str :
125
134
"""Return the unit of measurement."""
@@ -178,6 +187,11 @@ def device_class(self) -> SensorDeviceClass:
178
187
"""Return the device class of the sensor."""
179
188
return SensorDeviceClass .ENERGY
180
189
190
+ @property
191
+ def state_class (self ) -> SensorStateClass :
192
+ """Return the state class of the sensor."""
193
+ return SensorStateClass .TOTAL_INCREASING
194
+
181
195
@property
182
196
def native_unit_of_measurement (self ) -> str :
183
197
"""Return the unit of measurement."""
You can’t perform that action at this time.
0 commit comments