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

@ -5,10 +5,9 @@ import logging
import uscisstatus
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
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)
@ -33,7 +32,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
_LOGGER.error("Setup USCIS Sensor Fail check if your Case ID is Valid")
class UscisSensor(Entity):
class UscisSensor(SensorEntity):
"""USCIS Sensor will check case status on daily basis."""
MIN_TIME_BETWEEN_UPDATES = timedelta(hours=24)