Use ColorMode enum in iaqualink (#70510)

pull/70543/head
epenet 2022-04-23 21:16:27 +02:00 committed by GitHub
parent 346a385f1a
commit 149cc01ed3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -4,9 +4,8 @@ from __future__ import annotations
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_EFFECT,
COLOR_MODE_BRIGHTNESS,
COLOR_MODE_ONOFF,
DOMAIN,
ColorMode,
LightEntity,
LightEntityFeature,
)
@ -87,11 +86,11 @@ class HassAqualinkLight(AqualinkEntity, LightEntity):
return list(self.dev.supported_light_effects)
@property
def color_mode(self) -> str:
def color_mode(self) -> ColorMode:
"""Return the color mode of the light."""
if self.dev.is_dimmer:
return COLOR_MODE_BRIGHTNESS
return COLOR_MODE_ONOFF
return ColorMode.BRIGHTNESS
return ColorMode.ONOFF
@property
def supported_color_modes(self) -> set[str] | None: