Migrate integrations d-e to extend SensorEntity (#48211)
This commit is contained in:
parent
e0cd7072d6
commit
23b562386f
45 changed files with 100 additions and 115 deletions
|
@ -6,7 +6,7 @@ import random
|
|||
import discogs_client
|
||||
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_MONITORED_CONDITIONS,
|
||||
|
@ -15,7 +15,6 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.helpers.aiohttp_client import SERVER_SOFTWARE
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -89,7 +88,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
add_entities(sensors, True)
|
||||
|
||||
|
||||
class DiscogsSensor(Entity):
|
||||
class DiscogsSensor(SensorEntity):
|
||||
"""Create a new Discogs sensor for a specific type."""
|
||||
|
||||
def __init__(self, discogs_data, name, sensor_type):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue