Remove invalid return values in setup methods [a-h] (#63362)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
b14ac1b94a
commit
2709db008c
21 changed files with 242 additions and 55 deletions
|
@ -1,4 +1,6 @@
|
|||
"""Support for Blockchain.com sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
|
@ -7,7 +9,10 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
|
||||
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
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -29,7 +34,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 Blockchain.com sensors."""
|
||||
|
||||
addresses = config[CONF_ADDRESSES]
|
||||
|
@ -38,7 +48,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
for address in addresses:
|
||||
if not validate_address(address):
|
||||
_LOGGER.error("Bitcoin address is not valid: %s", address)
|
||||
return False
|
||||
return
|
||||
|
||||
add_entities([BlockchainSensor(name, addresses)], True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue