Migrate integrations t-v to extend SensorEntity (#48216)

This commit is contained in:
Erik Montnemery
2021-03-22 19:47:44 +01:00
committed by GitHub
parent c900e3030b
commit 783b453bbe
49 changed files with 112 additions and 120 deletions

View File

@@ -6,10 +6,9 @@ import requests
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, POWER_WATT, VOLT
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)
@@ -49,7 +48,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
return True
class Ted5000Sensor(Entity):
class Ted5000Sensor(SensorEntity):
"""Implementation of a Ted5000 sensor."""
def __init__(self, gateway, name, mtu, unit):