Move YAML config to component

This commit is contained in:
Pierre Ståhl
2020-09-24 22:06:00 +02:00
committed by rospogrigio
parent 450060488b
commit 0048ce6d5e
8 changed files with 42 additions and 132 deletions

View File

@@ -20,7 +20,6 @@ from homeassistant.const import (
from homeassistant.components.light import (
LightEntity,
DOMAIN,
PLATFORM_SCHEMA,
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
@@ -28,13 +27,8 @@ from homeassistant.components.light import (
SUPPORT_COLOR,
)
from . import (
BASE_PLATFORM_SCHEMA,
import_from_yaml,
)
from .common import LocalTuyaEntity, TuyaDevice, prepare_setup_entities
_LOGGER = logging.getLogger(__name__)
MIN_MIRED = 153
@@ -47,8 +41,6 @@ DPS_INDEX_BRIGHTNESS = "3"
DPS_INDEX_COLOURTEMP = "4"
DPS_INDEX_COLOUR = "5"
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(BASE_PLATFORM_SCHEMA)
def flow_schema(dps):
"""Return schema used in config flow."""
@@ -77,11 +69,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(lights, True)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up of the Tuya light."""
return import_from_yaml(hass, config, DOMAIN)
class LocaltuyaLight(LocalTuyaEntity, LightEntity):
"""Representation of a Tuya light."""