Store Philips TV runtime data in config entry (#116952)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
This commit is contained in:
parent
2cc916db6d
commit
16d86e5d4c
9 changed files with 191 additions and 44 deletions
|
@ -16,14 +16,12 @@ from homeassistant.components.light import (
|
|||
LightEntity,
|
||||
LightEntityFeature,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.util.color import color_hsv_to_RGB, color_RGB_to_hsv
|
||||
|
||||
from . import PhilipsTVDataUpdateCoordinator
|
||||
from .const import DOMAIN
|
||||
from . import PhilipsTVConfigEntry, PhilipsTVDataUpdateCoordinator
|
||||
from .entity import PhilipsJsEntity
|
||||
|
||||
EFFECT_PARTITION = ": "
|
||||
|
@ -35,11 +33,11 @@ EFFECT_EXPERT_STYLES = {"FOLLOW_AUDIO", "FOLLOW_COLOR", "Lounge light"}
|
|||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
config_entry: PhilipsTVConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the configuration entry."""
|
||||
coordinator = hass.data[DOMAIN][config_entry.entry_id]
|
||||
coordinator = config_entry.runtime_data
|
||||
async_add_entities([PhilipsTVLightEntity(coordinator)])
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue