aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-12-03 13:14:46 +0100
committerlonkaars <loek@pipeframe.xyz>2023-12-03 13:14:46 +0100
commitf2c20b7a2c2c45532b2784746e57b60dd4627784 (patch)
treec91a6ac6df0e99fe410c5a12ff025f08b3344039
parent34fed76110604cd34eb7992caa7318fb84f816fa (diff)
update for homeassistant 2023.11
-rw-r--r--light.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/light.py b/light.py
index c507726..69b9b86 100644
--- a/light.py
+++ b/light.py
@@ -7,17 +7,14 @@ from .driver import BekenConnection, makemsg, BEKEN_CHARACTERISTIC_LAMP
from homeassistant.components.light import (
LightEntity,
- SUPPORT_BRIGHTNESS,
- SUPPORT_COLOR,
- SUPPORT_WHITE_VALUE,
- SUPPORT_TRANSITION,
-
ATTR_BRIGHTNESS,
ATTR_RGBW_COLOR,
ATTR_TRANSITION,
- COLOR_MODE_RGBW,
- PLATFORM_SCHEMA
+ PLATFORM_SCHEMA,
+
+ LightEntityFeature,
+ ColorMode,
)
from time import sleep
@@ -26,9 +23,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required("address"): cv.string
})
-SUPPORT_FEATURES_RGB = SUPPORT_BRIGHTNESS | SUPPORT_COLOR
-SUPPORT_FEATURES_WHITE = SUPPORT_BRIGHTNESS
-
def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([ BekenLight(name=config["name"], address=config["address"]) ])
@@ -48,15 +42,15 @@ class BekenLight(LightEntity):
@property
def color_mode(self):
- return COLOR_MODE_RGBW
+ return ColorMode.RGBW
@property
def supported_color_modes(self):
- return set([ COLOR_MODE_RGBW ])
+ return set([ ColorMode.RGBW ])
@property
def supported_features(self):
- return SUPPORT_BRIGHTNESS | SUPPORT_COLOR | SUPPORT_WHITE_VALUE | SUPPORT_TRANSITION
+ return LightEntityFeature.TRANSITION
@property
def unique_id(self):