mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Remove last_reset attribute from sma energy sensors (#54814)
This commit is contained in:
parent
0b7b4152f1
commit
60f8e24bde
@ -9,7 +9,7 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
PLATFORM_SCHEMA,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
STATE_CLASS_TOTAL_INCREASING,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||
@ -32,7 +32,6 @@ from homeassistant.helpers.update_coordinator import (
|
||||
CoordinatorEntity,
|
||||
DataUpdateCoordinator,
|
||||
)
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
from .const import (
|
||||
CONF_CUSTOM,
|
||||
@ -165,9 +164,8 @@ class SMAsensor(CoordinatorEntity, SensorEntity):
|
||||
self._device_info = device_info
|
||||
|
||||
if self.unit_of_measurement == ENERGY_KILO_WATT_HOUR:
|
||||
self._attr_state_class = STATE_CLASS_MEASUREMENT
|
||||
self._attr_state_class = STATE_CLASS_TOTAL_INCREASING
|
||||
self._attr_device_class = DEVICE_CLASS_ENERGY
|
||||
self._attr_last_reset = dt_util.utc_from_timestamp(0)
|
||||
|
||||
# Set sensor enabled to False.
|
||||
# Will be enabled by async_added_to_hass if actually used.
|
||||
|
Loading…
x
Reference in New Issue
Block a user