Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for new Lutron RGB tape light #130731

Merged
1 change: 1 addition & 0 deletions homeassistant/components/lutron_caseta/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

DEVICE_TYPE_WHITE_TUNE = "WhiteTune"
DEVICE_TYPE_SPECTRUM_TUNE = "SpectrumTune"
DEVICE_TYPE_COLOR_TUNE = "ColorTune"

MANUFACTURER = "Lutron Electronics Co., Inc"

Expand Down
27 changes: 23 additions & 4 deletions homeassistant/components/lutron_caseta/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback

from .const import DEVICE_TYPE_SPECTRUM_TUNE, DEVICE_TYPE_WHITE_TUNE
from .const import (
DEVICE_TYPE_COLOR_TUNE,
DEVICE_TYPE_SPECTRUM_TUNE,
DEVICE_TYPE_WHITE_TUNE,
)
from .entity import LutronCasetaUpdatableEntity
from .models import LutronCasetaData

Expand All @@ -35,9 +39,18 @@
ColorMode.WHITE,
},
DEVICE_TYPE_WHITE_TUNE: {ColorMode.COLOR_TEMP},
DEVICE_TYPE_COLOR_TUNE: {
ColorMode.HS,
ColorMode.COLOR_TEMP,
ColorMode.WHITE,
},
}

WARM_DEVICE_TYPES = {DEVICE_TYPE_WHITE_TUNE, DEVICE_TYPE_SPECTRUM_TUNE}
WARM_DEVICE_TYPES = {
DEVICE_TYPE_WHITE_TUNE,
DEVICE_TYPE_SPECTRUM_TUNE,
DEVICE_TYPE_COLOR_TUNE,
}


def to_lutron_level(level):
Expand Down Expand Up @@ -90,8 +103,14 @@ def __init__(self, light: dict[str, Any], data: LutronCasetaData) -> None:
)

self.supports_warm_cool = light_type in WARM_DEVICE_TYPES
self.supports_warm_dim = light_type == DEVICE_TYPE_SPECTRUM_TUNE
self.supports_spectrum_tune = light_type == DEVICE_TYPE_SPECTRUM_TUNE
self.supports_warm_dim = light_type in (
DEVICE_TYPE_SPECTRUM_TUNE,
DEVICE_TYPE_COLOR_TUNE,
)
self.supports_spectrum_tune = light_type in (
DEVICE_TYPE_SPECTRUM_TUNE,
DEVICE_TYPE_COLOR_TUNE,
)
RBaragona marked this conversation as resolved.
Show resolved Hide resolved

def _get_min_color_temp_kelvin(self, light: dict[str, Any]) -> int:
"""Return minimum supported color temperature.
Expand Down