Add Shelly support for REST sensors (#40429)

This commit is contained in:
Simone Chemelli 2020-11-11 20:13:14 +01:00 committed by GitHub
parent 403514ccb3
commit d8b067ebf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 311 additions and 16 deletions

View file

@ -5,14 +5,14 @@ from homeassistant.components.switch import SwitchEntity
from homeassistant.core import callback
from . import ShellyDeviceWrapper
from .const import DATA_CONFIG_ENTRY, DOMAIN
from .const import COAP, DATA_CONFIG_ENTRY, DOMAIN
from .entity import ShellyBlockEntity
from .utils import async_remove_entity_by_domain
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up switches for device."""
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry.entry_id]
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry.entry_id][COAP]
# In roller mode the relay blocks exist but do not contain required info
if (