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,7 +5,7 @@ import socket
|
|||
|
||||
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_NAME,
|
||||
|
@ -17,7 +17,6 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.exceptions import TemplateError
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -48,7 +47,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
add_entities([TcpSensor(hass, config)])
|
||||
|
||||
|
||||
class TcpSensor(Entity):
|
||||
class TcpSensor(SensorEntity):
|
||||
"""Implementation of a TCP socket based sensor."""
|
||||
|
||||
required = ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue