Remove last_reset attribute from wemo energy sensors (#54821)
parent
4892f6b094
commit
6eba04c454
|
@ -1,10 +1,11 @@
|
||||||
"""Support for power sensors in WeMo Insight devices."""
|
"""Support for power sensors in WeMo Insight devices."""
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import datetime, timedelta
|
from datetime import timedelta
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
STATE_CLASS_TOTAL_INCREASING,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
|
@ -16,7 +17,7 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.typing import StateType
|
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 .const import DOMAIN as WEMO_DOMAIN
|
||||||
from .entity import WemoSubscriptionEntity
|
from .entity import WemoSubscriptionEntity
|
||||||
|
@ -113,15 +114,10 @@ class InsightTodayEnergy(InsightSensor):
|
||||||
key="todaymw",
|
key="todaymw",
|
||||||
name="Today Energy",
|
name="Today Energy",
|
||||||
device_class=DEVICE_CLASS_ENERGY,
|
device_class=DEVICE_CLASS_ENERGY,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||||
unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
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
|
@property
|
||||||
def native_value(self) -> StateType:
|
def native_value(self) -> StateType:
|
||||||
"""Return the current energy use today."""
|
"""Return the current energy use today."""
|
||||||
|
|
Loading…
Reference in New Issue