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
|
@ -6,7 +6,7 @@ from netdata import Netdata
|
|||
from netdata.exceptions import NetdataError
|
||||
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_ICON,
|
||||
|
@ -18,7 +18,6 @@ from homeassistant.const import (
|
|||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -97,7 +96,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||
async_add_entities(dev, True)
|
||||
|
||||
|
||||
class NetdataSensor(Entity):
|
||||
class NetdataSensor(SensorEntity):
|
||||
"""Implementation of a Netdata sensor."""
|
||||
|
||||
def __init__(self, netdata, name, sensor, sensor_name, element, icon, unit, invert):
|
||||
|
@ -146,7 +145,7 @@ class NetdataSensor(Entity):
|
|||
)
|
||||
|
||||
|
||||
class NetdataAlarms(Entity):
|
||||
class NetdataAlarms(SensorEntity):
|
||||
"""Implementation of a Netdata alarm sensor."""
|
||||
|
||||
def __init__(self, netdata, name, host, port):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue