From 1970e36f10362822dba4e9d973d1936f3538adf3 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 29 Jun 2022 11:03:53 +0200 Subject: [PATCH] Fix CI (tuya number and abode light) (#74163) * Fix tuya unit_of_measurement * Fix abode ColorMode --- homeassistant/components/abode/light.py | 19 ++++++++----------- homeassistant/components/tuya/number.py | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/abode/light.py b/homeassistant/components/abode/light.py index 6d1123cd233..1bb9d41f461 100644 --- a/homeassistant/components/abode/light.py +++ b/homeassistant/components/abode/light.py @@ -11,10 +11,7 @@ from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, - COLOR_MODE_BRIGHTNESS, - COLOR_MODE_COLOR_TEMP, - COLOR_MODE_HS, - COLOR_MODE_ONOFF, + ColorMode, LightEntity, ) from homeassistant.config_entries import ConfigEntry @@ -107,20 +104,20 @@ class AbodeLight(AbodeDevice, LightEntity): """Return the color mode of the light.""" if self._device.is_dimmable and self._device.is_color_capable: if self.hs_color is not None: - return COLOR_MODE_HS - return COLOR_MODE_COLOR_TEMP + return ColorMode.HS + return ColorMode.COLOR_TEMP if self._device.is_dimmable: - return COLOR_MODE_BRIGHTNESS - return COLOR_MODE_ONOFF + return ColorMode.BRIGHTNESS + return ColorMode.ONOFF @property def supported_color_modes(self) -> set[str] | None: """Flag supported color modes.""" 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: - return {COLOR_MODE_BRIGHTNESS} - return {COLOR_MODE_ONOFF} + return {ColorMode.BRIGHTNESS} + return {ColorMode.ONOFF} @property def supported_features(self) -> int: diff --git a/homeassistant/components/tuya/number.py b/homeassistant/components/tuya/number.py index b1afeb0364c..e7712dcf630 100644 --- a/homeassistant/components/tuya/number.py +++ b/homeassistant/components/tuya/number.py @@ -146,7 +146,7 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = { key=DPCode.COOK_TIME, name="Cook Time", icon="mdi:timer", - unit_of_measurement=TIME_MINUTES, + native_unit_of_measurement=TIME_MINUTES, entity_category=EntityCategory.CONFIG, ), NumberEntityDescription(