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
12 changes: 4 additions & 8 deletions homeassistant/components/wemo/sensor.py
Original file line number Diff line number Diff line change
@@ -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,
)
Expand All @@ -16,7 +17,7 @@
)
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
Expand Down Expand Up @@ -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."""
Expand Down