Migrate integrations r-s to extend SensorEntity (#48215)
This commit is contained in:
parent
0c086b5067
commit
64bc9a8196
75 changed files with 173 additions and 189 deletions
|
@ -7,7 +7,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.recorder.models import States
|
||||
from homeassistant.components.recorder.util import execute, session_scope
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.const import (
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
CONF_ENTITY_ID,
|
||||
|
@ -18,7 +18,6 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.event import (
|
||||
async_track_point_in_utc_time,
|
||||
async_track_state_change_event,
|
||||
|
@ -85,7 +84,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||
return True
|
||||
|
||||
|
||||
class StatisticsSensor(Entity):
|
||||
class StatisticsSensor(SensorEntity):
|
||||
"""Representation of a Statistics sensor."""
|
||||
|
||||
def __init__(self, entity_id, name, sampling_size, max_age, precision):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue