mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 22:55:10 +02:00
Remove useless try-except from Tasmota binary sensor (#41462)
This commit is contained in:
@@ -8,7 +8,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
|||||||
import homeassistant.helpers.event as evt
|
import homeassistant.helpers.event as evt
|
||||||
|
|
||||||
from .const import DOMAIN as TASMOTA_DOMAIN
|
from .const import DOMAIN as TASMOTA_DOMAIN
|
||||||
from .discovery import TASMOTA_DISCOVERY_ENTITY_NEW, clear_discovery_hash
|
from .discovery import TASMOTA_DISCOVERY_ENTITY_NEW
|
||||||
from .mixins import TasmotaAvailability, TasmotaDiscoveryUpdate
|
from .mixins import TasmotaAvailability, TasmotaDiscoveryUpdate
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@@ -20,17 +20,13 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
@callback
|
@callback
|
||||||
def async_discover(tasmota_entity, discovery_hash):
|
def async_discover(tasmota_entity, discovery_hash):
|
||||||
"""Discover and add a Tasmota binary sensor."""
|
"""Discover and add a Tasmota binary sensor."""
|
||||||
try:
|
async_add_entities(
|
||||||
async_add_entities(
|
[
|
||||||
[
|
TasmotaBinarySensor(
|
||||||
TasmotaBinarySensor(
|
tasmota_entity=tasmota_entity, discovery_hash=discovery_hash
|
||||||
tasmota_entity=tasmota_entity, discovery_hash=discovery_hash
|
)
|
||||||
)
|
]
|
||||||
]
|
)
|
||||||
)
|
|
||||||
except Exception:
|
|
||||||
clear_discovery_hash(hass, discovery_hash)
|
|
||||||
raise
|
|
||||||
|
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
hass,
|
hass,
|
||||||
|
Reference in New Issue
Block a user