mirror of
https://github.com/home-assistant/core.git
synced 2025-11-28 03:58:01 +00:00
Add sensor setup type hints [e-f] (#63317)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
"""Support for Etherscan sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
from pyetherscan import get_balance
|
||||
@@ -6,7 +8,10 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_ADDRESS, CONF_NAME, CONF_TOKEN
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
ATTRIBUTION = "Data provided by etherscan.io"
|
||||
|
||||
@@ -24,7 +29,12 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
def setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up the Etherscan.io sensors."""
|
||||
address = config.get(CONF_ADDRESS)
|
||||
name = config.get(CONF_NAME)
|
||||
|
||||
Reference in New Issue
Block a user