Use core constants for dynalite (#46044)
parent
1a8cdba9af
commit
2ecac6550f
|
@ -8,7 +8,7 @@ import voluptuous as vol
|
|||
from homeassistant import config_entries
|
||||
from homeassistant.components.cover import DEVICE_CLASSES_SCHEMA
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, CONF_TYPE
|
||||
from homeassistant.const import CONF_DEFAULT, CONF_HOST, CONF_NAME, CONF_PORT, CONF_TYPE
|
||||
from homeassistant.core import HomeAssistant, ServiceCall
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
|
@ -29,7 +29,6 @@ from .const import (
|
|||
CONF_CHANNEL,
|
||||
CONF_CHANNEL_COVER,
|
||||
CONF_CLOSE_PRESET,
|
||||
CONF_DEFAULT,
|
||||
CONF_DEVICE_CLASS,
|
||||
CONF_DURATION,
|
||||
CONF_FADE,
|
||||
|
@ -181,7 +180,6 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
|
||||
async def async_setup(hass: HomeAssistant, config: Dict[str, Any]) -> bool:
|
||||
"""Set up the Dynalite platform."""
|
||||
|
||||
conf = config.get(DOMAIN)
|
||||
LOGGER.debug("Setting up dynalite component config = %s", conf)
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ CONF_BRIDGES = "bridges"
|
|||
CONF_CHANNEL = "channel"
|
||||
CONF_CHANNEL_COVER = "channel_cover"
|
||||
CONF_CLOSE_PRESET = "close"
|
||||
CONF_DEFAULT = "default"
|
||||
CONF_DEVICE_CLASS = "class"
|
||||
CONF_DURATION = "duration"
|
||||
CONF_FADE = "fade"
|
||||
|
|
|
@ -4,7 +4,14 @@ from typing import Any, Dict
|
|||
|
||||
from dynalite_devices_lib import const as dyn_const
|
||||
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, CONF_ROOM, CONF_TYPE
|
||||
from homeassistant.const import (
|
||||
CONF_DEFAULT,
|
||||
CONF_HOST,
|
||||
CONF_NAME,
|
||||
CONF_PORT,
|
||||
CONF_ROOM,
|
||||
CONF_TYPE,
|
||||
)
|
||||
|
||||
from .const import (
|
||||
ACTIVE_INIT,
|
||||
|
@ -16,7 +23,6 @@ from .const import (
|
|||
CONF_CHANNEL,
|
||||
CONF_CHANNEL_COVER,
|
||||
CONF_CLOSE_PRESET,
|
||||
CONF_DEFAULT,
|
||||
CONF_DEVICE_CLASS,
|
||||
CONF_DURATION,
|
||||
CONF_FADE,
|
||||
|
|
|
@ -12,7 +12,6 @@ async def async_setup_entry(
|
|||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
||||
) -> None:
|
||||
"""Record the async_add_entities function to add them later when received from Dynalite."""
|
||||
|
||||
async_setup_entry_base(
|
||||
hass, config_entry, async_add_entities, "light", DynaliteLight
|
||||
)
|
||||
|
|
|
@ -12,7 +12,6 @@ async def async_setup_entry(
|
|||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
||||
) -> None:
|
||||
"""Record the async_add_entities function to add them later when received from Dynalite."""
|
||||
|
||||
async_setup_entry_base(
|
||||
hass, config_entry, async_add_entities, "switch", DynaliteSwitch
|
||||
)
|
||||
|
|
|
@ -7,7 +7,7 @@ import pytest
|
|||
from voluptuous import MultipleInvalid
|
||||
|
||||
import homeassistant.components.dynalite.const as dynalite
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, CONF_ROOM
|
||||
from homeassistant.const import CONF_DEFAULT, CONF_HOST, CONF_NAME, CONF_PORT, CONF_ROOM
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
@ -54,7 +54,7 @@ async def test_async_setup(hass):
|
|||
dynalite.CONF_TEMPLATE: dynalite.CONF_TIME_COVER,
|
||||
},
|
||||
},
|
||||
dynalite.CONF_DEFAULT: {dynalite.CONF_FADE: 2.3},
|
||||
CONF_DEFAULT: {dynalite.CONF_FADE: 2.3},
|
||||
dynalite.CONF_ACTIVE: dynalite.ACTIVE_INIT,
|
||||
dynalite.CONF_PRESET: {
|
||||
"5": {CONF_NAME: "pres5", dynalite.CONF_FADE: 4.5}
|
||||
|
|
Loading…
Reference in New Issue