1
mirror of https://github.com/home-assistant/core synced 2024-08-06 09:34:49 +02:00

Remove last_reset attribute from wemo energy sensors (#54821)

This commit is contained in:
Erik Montnemery 2021-08-18 16:45:16 +02:00 committed by GitHub
parent 4892f6b094
commit 6eba04c454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,11 @@
"""Support for power sensors in WeMo Insight devices."""
import asyncio
from datetime import datetime, timedelta
from datetime import timedelta
from typing import Callable
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorEntity,
SensorEntityDescription,
)
@ -16,7 +17,7 @@ from homeassistant.const import (
)
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.typing import StateType
from homeassistant.util import Throttle, convert, dt
from homeassistant.util import Throttle, convert
from .const import DOMAIN as WEMO_DOMAIN
from .entity import WemoSubscriptionEntity
@ -113,15 +114,10 @@ class InsightTodayEnergy(InsightSensor):
key="todaymw",
name="Today Energy",
device_class=DEVICE_CLASS_ENERGY,
state_class=STATE_CLASS_MEASUREMENT,
state_class=STATE_CLASS_TOTAL_INCREASING,
unit_of_measurement=ENERGY_KILO_WATT_HOUR,
)
@property
def last_reset(self) -> datetime:
"""Return the time when the sensor was initialized."""
return dt.start_of_local_day()
@property
def native_value(self) -> StateType:
"""Return the current energy use today."""