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,6 +1,7 @@
"""Support for Luftdaten sensors."""
import logging
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
@ -9,7 +10,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 . import (
DATA_LUFTDATEN,
@ -45,7 +45,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
async_add_entities(sensors, True)
class LuftdatenSensor(Entity):
class LuftdatenSensor(SensorEntity):
"""Implementation of a Luftdaten sensor."""
def __init__(self, luftdaten, sensor_type, name, icon, unit, show):