Migrate integrations i-m to extend SensorEntity (#48213)

This commit is contained in:
Erik Montnemery 2021-03-22 19:59:03 +01:00 committed by GitHub
parent 64bc9a8196
commit fdf97eaca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 152 additions and 157 deletions

View file

@ -1,4 +1,5 @@
"""Support for DHT and DS18B20 sensors attached to a Konnected device."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
CONF_DEVICES,
CONF_NAME,
@ -12,7 +13,6 @@ from homeassistant.const import (
)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from .const import DOMAIN as KONNECTED_DOMAIN, SIGNAL_DS18B20_NEW
@ -70,7 +70,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_dispatcher_connect(hass, SIGNAL_DS18B20_NEW, async_add_ds18b20)
class KonnectedSensor(Entity):
class KonnectedSensor(SensorEntity):
"""Represents a Konnected DHT Sensor."""
def __init__(self, device_id, data, sensor_type, addr=None, initial_state=None):