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
|
@ -4,10 +4,9 @@ from datetime import timedelta
|
|||
from pyetherscan import get_balance
|
||||
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_ADDRESS, CONF_NAME, CONF_TOKEN
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
ATTRIBUTION = "Data provided by etherscan.io"
|
||||
|
||||
|
@ -42,7 +41,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
add_entities([EtherscanSensor(name, address, token, token_address)], True)
|
||||
|
||||
|
||||
class EtherscanSensor(Entity):
|
||||
class EtherscanSensor(SensorEntity):
|
||||
"""Representation of an Etherscan.io sensor."""
|
||||
|
||||
def __init__(self, name, address, token, token_address):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue