Support for Shelly Binary Input Sensors (#43313)

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Shay Levy 2020-11-19 12:42:24 +02:00 committed by GitHub
parent 3dbfd2cb70
commit 982624b3ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 55 deletions

View file

@ -7,7 +7,7 @@ from homeassistant.core import callback
from . import ShellyDeviceWrapper
from .const import COAP, DATA_CONFIG_ENTRY, DOMAIN
from .entity import ShellyBlockEntity
from .utils import async_remove_entity_by_domain
from .utils import async_remove_shelly_entity
async def async_setup_entry(hass, config_entry, async_add_entities):
@ -32,11 +32,10 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
unique_id = (
f'{wrapper.device.shelly["mac"]}-{block.type}_{block.channel}'
)
await async_remove_entity_by_domain(
await async_remove_shelly_entity(
hass,
"light",
unique_id,
config_entry.entry_id,
)
if not relay_blocks: