Fix CI (tuya number and abode light) (#74163)
* Fix tuya unit_of_measurement * Fix abode ColorMode
This commit is contained in:
parent
9d73f9a2c5
commit
1970e36f10
2 changed files with 9 additions and 12 deletions
|
@ -11,10 +11,7 @@ from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_COLOR_TEMP,
|
ATTR_COLOR_TEMP,
|
||||||
ATTR_HS_COLOR,
|
ATTR_HS_COLOR,
|
||||||
COLOR_MODE_BRIGHTNESS,
|
ColorMode,
|
||||||
COLOR_MODE_COLOR_TEMP,
|
|
||||||
COLOR_MODE_HS,
|
|
||||||
COLOR_MODE_ONOFF,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
@ -107,20 +104,20 @@ class AbodeLight(AbodeDevice, LightEntity):
|
||||||
"""Return the color mode of the light."""
|
"""Return the color mode of the light."""
|
||||||
if self._device.is_dimmable and self._device.is_color_capable:
|
if self._device.is_dimmable and self._device.is_color_capable:
|
||||||
if self.hs_color is not None:
|
if self.hs_color is not None:
|
||||||
return COLOR_MODE_HS
|
return ColorMode.HS
|
||||||
return COLOR_MODE_COLOR_TEMP
|
return ColorMode.COLOR_TEMP
|
||||||
if self._device.is_dimmable:
|
if self._device.is_dimmable:
|
||||||
return COLOR_MODE_BRIGHTNESS
|
return ColorMode.BRIGHTNESS
|
||||||
return COLOR_MODE_ONOFF
|
return ColorMode.ONOFF
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_color_modes(self) -> set[str] | None:
|
def supported_color_modes(self) -> set[str] | None:
|
||||||
"""Flag supported color modes."""
|
"""Flag supported color modes."""
|
||||||
if self._device.is_dimmable and self._device.is_color_capable:
|
if self._device.is_dimmable and self._device.is_color_capable:
|
||||||
return {COLOR_MODE_COLOR_TEMP, COLOR_MODE_HS}
|
return {ColorMode.COLOR_TEMP, ColorMode.HS}
|
||||||
if self._device.is_dimmable:
|
if self._device.is_dimmable:
|
||||||
return {COLOR_MODE_BRIGHTNESS}
|
return {ColorMode.BRIGHTNESS}
|
||||||
return {COLOR_MODE_ONOFF}
|
return {ColorMode.ONOFF}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self) -> int:
|
def supported_features(self) -> int:
|
||||||
|
|
|
@ -146,7 +146,7 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
|
||||||
key=DPCode.COOK_TIME,
|
key=DPCode.COOK_TIME,
|
||||||
name="Cook Time",
|
name="Cook Time",
|
||||||
icon="mdi:timer",
|
icon="mdi:timer",
|
||||||
unit_of_measurement=TIME_MINUTES,
|
native_unit_of_measurement=TIME_MINUTES,
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
),
|
),
|
||||||
NumberEntityDescription(
|
NumberEntityDescription(
|
||||||
|
|
Loading…
Add table
Reference in a new issue