Migrate integrations r-s to extend SensorEntity (#48215)

This commit is contained in:
Erik Montnemery 2021-03-22 19:54:14 +01:00 committed by GitHub
parent 0c086b5067
commit 64bc9a8196
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 173 additions and 189 deletions

View file

@ -5,11 +5,10 @@ import logging
from pysyncthru import SYNCTHRU_STATE_HUMAN, SyncThru
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import CONF_NAME, CONF_RESOURCE, CONF_URL, PERCENTAGE
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from . import device_identifiers
from .const import DEFAULT_MODEL, DEFAULT_NAME_TEMPLATE, DOMAIN
@ -81,7 +80,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(devices, True)
class SyncThruSensor(Entity):
class SyncThruSensor(SensorEntity):
"""Implementation of an abstract Samsung Printer sensor platform."""
def __init__(self, syncthru, name):