Migrate integrations n-q to extend SensorEntity (#48214)

This commit is contained in:
Erik Montnemery 2021-03-22 19:46:46 +01:00 committed by GitHub
parent 339a56e434
commit c900e3030b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 129 additions and 136 deletions

View file

@ -6,7 +6,7 @@ from aiohttp.hdrs import CONTENT_TYPE
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
CONF_HOST,
CONF_MONITORED_VARIABLES,
@ -19,7 +19,6 @@ from homeassistant.const import (
DATA_RATE_MEGABYTES_PER_SECOND,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)
@ -77,7 +76,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices, True)
class PyLoadSensor(Entity):
class PyLoadSensor(SensorEntity):
"""Representation of a pyLoad sensor."""
def __init__(self, api, sensor_type, client_name):