Migrate integrations n-q to extend SensorEntity (#48214)
This commit is contained in:
parent
339a56e434
commit
c900e3030b
57 changed files with 129 additions and 136 deletions
|
@ -4,7 +4,7 @@ import logging
|
|||
from pyrail import iRail
|
||||
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,
|
||||
ATTR_LATITUDE,
|
||||
|
@ -14,7 +14,6 @@ from homeassistant.const import (
|
|||
TIME_MINUTES,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -88,7 +87,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
add_entities(sensors, True)
|
||||
|
||||
|
||||
class NMBSLiveBoard(Entity):
|
||||
class NMBSLiveBoard(SensorEntity):
|
||||
"""Get the next train from a station's liveboard."""
|
||||
|
||||
def __init__(self, api_client, live_station, station_from, station_to):
|
||||
|
@ -164,7 +163,7 @@ class NMBSLiveBoard(Entity):
|
|||
)
|
||||
|
||||
|
||||
class NMBSSensor(Entity):
|
||||
class NMBSSensor(SensorEntity):
|
||||
"""Get the the total travel time for a given connection."""
|
||||
|
||||
def __init__(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue