Skip to content

Commit

Permalink
Merge pull request #21 from tijsverkoyen/18-last-reset
Browse files Browse the repository at this point in the history
Use total as state_class
  • Loading branch information
tijsverkoyen authored Dec 6, 2022
2 parents 6698ecf + 744f068 commit b41ec61
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import datetime

from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, STATE_CLASS_TOTAL_INCREASING, SensorEntity
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, STATE_CLASS_TOTAL_INCREASING, STATE_CLASS_TOTAL, \
SensorEntity
from homeassistant.components.binary_sensor import DEVICE_CLASS_CONNECTIVITY, BinarySensorEntity
from homeassistant.const import DEVICE_CLASS_VOLTAGE, ELECTRIC_POTENTIAL_VOLT, DEVICE_CLASS_CURRENT, \
ELECTRIC_CURRENT_AMPERE, DEVICE_CLASS_ENERGY, DEVICE_CLASS_TEMPERATURE, \
Expand Down Expand Up @@ -169,11 +170,7 @@ def unit_of_measurement(self) -> str:

@property
def state_class(self) -> str:
return STATE_CLASS_MEASUREMENT

@property
def last_reset(self) -> None:
return None
return STATE_CLASS_TOTAL


class FusionSolarRealtimeDeviceDataEnergyTotalIncreasingSensor(FusionSolarRealtimeDeviceDataEnergySensor):
Expand Down

0 comments on commit b41ec61

Please sign in to comment.