Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions homeassistant/components/saj/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorEntity,
)
from homeassistant.const import (
Expand All @@ -34,7 +35,6 @@
from homeassistant.exceptions import PlatformNotReady
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_call_later
from homeassistant.util import dt as dt_util

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -177,10 +177,10 @@ def __init__(self, serialnumber, pysaj_sensor, inverter_name=None):
self._serialnumber = serialnumber
self._state = self._sensor.value

if pysaj_sensor.name in ("current_power", "total_yield", "temperature"):
if pysaj_sensor.name in ("current_power", "temperature"):
self._attr_state_class = STATE_CLASS_MEASUREMENT
if pysaj_sensor.name == "total_yield":
self._attr_last_reset = dt_util.utc_from_timestamp(0)
self._attr_state_class = STATE_CLASS_TOTAL_INCREASING

@property
def name(self):
Expand Down