Migrate integrations t-v to extend SensorEntity (#48216)
This commit is contained in:
parent
c900e3030b
commit
783b453bbe
49 changed files with 112 additions and 120 deletions
|
@ -5,10 +5,9 @@ import logging
|
|||
import vasttrafik
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_DELAY, CONF_NAME
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
from homeassistant.util.dt import now
|
||||
|
||||
|
@ -71,7 +70,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
add_entities(sensors, True)
|
||||
|
||||
|
||||
class VasttrafikDepartureSensor(Entity):
|
||||
class VasttrafikDepartureSensor(SensorEntity):
|
||||
"""Implementation of a Vasttrafik Departure Sensor."""
|
||||
|
||||
def __init__(self, planner, name, departure, heading, lines, delay):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue