Migrate integrations d-e to extend SensorEntity (#48211)
This commit is contained in:
parent
e0cd7072d6
commit
23b562386f
45 changed files with 100 additions and 115 deletions
|
@ -6,7 +6,11 @@ import forecastio
|
|||
from requests.exceptions import ConnectionError as ConnectError, HTTPError, Timeout
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import DEVICE_CLASS_TEMPERATURE, PLATFORM_SCHEMA
|
||||
from homeassistant.components.sensor import (
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
PLATFORM_SCHEMA,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION,
|
||||
CONF_API_KEY,
|
||||
|
@ -29,7 +33,6 @@ from homeassistant.const import (
|
|||
UV_INDEX,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -544,7 +547,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
add_entities(sensors, True)
|
||||
|
||||
|
||||
class DarkSkySensor(Entity):
|
||||
class DarkSkySensor(SensorEntity):
|
||||
"""Implementation of a Dark Sky sensor."""
|
||||
|
||||
def __init__(
|
||||
|
@ -708,7 +711,7 @@ class DarkSkySensor(Entity):
|
|||
return state
|
||||
|
||||
|
||||
class DarkSkyAlertSensor(Entity):
|
||||
class DarkSkyAlertSensor(SensorEntity):
|
||||
"""Implementation of a Dark Sky sensor."""
|
||||
|
||||
def __init__(self, forecast_data, sensor_type, name):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue