Migrate integrations t-v to extend SensorEntity (#48216)

This commit is contained in:
Erik Montnemery 2021-03-22 19:47:44 +01:00 committed by GitHub
parent c900e3030b
commit 783b453bbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 112 additions and 120 deletions

View file

@ -10,11 +10,10 @@ from pyhaversion import (
)
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_NAME, CONF_SOURCE
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
ALL_IMAGES = [
@ -94,7 +93,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([VersionSensor(haversion, name)], True)
class VersionSensor(Entity):
class VersionSensor(SensorEntity):
"""Representation of a Home Assistant version sensor."""
def __init__(self, haversion, name):