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
62 changed files with 152 additions and 157 deletions

View File

@@ -7,11 +7,10 @@ import logging
from pylaunches import PyLaunches, PyLaunchesException
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from .const import (
ATTR_AGENCY,
@@ -40,7 +39,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([LaunchLibrarySensor(launches, name)], True)
class LaunchLibrarySensor(Entity):
class LaunchLibrarySensor(SensorEntity):
"""Representation of a launch_library Sensor."""
def __init__(self, launches: PyLaunches, name: str) -> None: