Migrate integrations f-h to extend SensorEntity (#48212)

This commit is contained in:
Erik Montnemery 2021-03-22 19:45:17 +01:00 committed by GitHub
parent a49989241a
commit 339a56e434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 154 additions and 167 deletions

View file

@ -5,7 +5,7 @@ import socket
from gps3.agps3threaded import AGPS3mechanism
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
ATTR_LATITUDE,
ATTR_LONGITUDE,
@ -15,7 +15,6 @@ from homeassistant.const import (
CONF_PORT,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
@ -65,7 +64,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([GpsdSensor(hass, name, host, port)])
class GpsdSensor(Entity):
class GpsdSensor(SensorEntity):
"""Representation of a GPS receiver available via GPSD."""
def __init__(self, hass, name, host, port):