From 346a385f1a59dcaba1ced656e62d886f7eb4aac2 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sat, 23 Apr 2022 21:16:07 +0200 Subject: [PATCH] Use ColorMode enum in ihc (#70508) --- homeassistant/components/ihc/light.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/ihc/light.py b/homeassistant/components/ihc/light.py index 54075fdedac..caceaf9737c 100644 --- a/homeassistant/components/ihc/light.py +++ b/homeassistant/components/ihc/light.py @@ -3,12 +3,7 @@ from __future__ import annotations from ihcsdk.ihccontroller import IHCController -from homeassistant.components.light import ( - ATTR_BRIGHTNESS, - COLOR_MODE_BRIGHTNESS, - COLOR_MODE_ONOFF, - LightEntity, -) +from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType @@ -80,9 +75,9 @@ class IhcLight(IHCDevice, LightEntity): self._state = False if self._dimmable: - self._attr_color_mode = COLOR_MODE_BRIGHTNESS + self._attr_color_mode = ColorMode.BRIGHTNESS else: - self._attr_color_mode = COLOR_MODE_ONOFF + self._attr_color_mode = ColorMode.ONOFF self._attr_supported_color_modes = {self._attr_color_mode} @property