Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 1 addition & 6 deletions homeassistant/components/derivative/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@

import voluptuous as vol

from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
SensorEntity,
SensorStateClass,
)
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
Expand Down Expand Up @@ -135,7 +131,6 @@ class DerivativeSensor(RestoreEntity, SensorEntity):

_attr_icon = ICON
_attr_should_poll = False
_attr_state_class = SensorStateClass.MEASUREMENT

def __init__(
self,
Expand Down
2 changes: 0 additions & 2 deletions tests/components/derivative/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import random
from unittest.mock import patch

from homeassistant.components.sensor import ATTR_STATE_CLASS, SensorStateClass
from homeassistant.const import UnitOfPower, UnitOfTime
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
Expand Down Expand Up @@ -79,7 +78,6 @@ async def setup_tests(hass, config, times, values, expected_state):
assert state is not None

assert round(float(state.state), config["sensor"]["round"]) == expected_state
assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT

return state

Expand Down