mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Tweak Tradfri (#7172)
This commit is contained in:
parent
90baa2ce4d
commit
1a635fede3
@ -46,17 +46,15 @@ class Tradfri(Light):
|
|||||||
self._light_data = light.light_control.lights[0]
|
self._light_data = light.light_control.lights[0]
|
||||||
self._name = light.name
|
self._name = light.name
|
||||||
self._rgb_color = None
|
self._rgb_color = None
|
||||||
|
self._features = ALLOWED_FEATURES.get(
|
||||||
|
slugify(self._light.device_info.manufacturer), SUPPORTED_FEATURES)
|
||||||
self._ok_temps = ALLOWED_TEMPERATURES.get(
|
self._ok_temps = ALLOWED_TEMPERATURES.get(
|
||||||
slugify(self._light.device_info.manufacturer))
|
slugify(self._light.device_info.manufacturer))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
features = ALLOWED_FEATURES.get(
|
return self._features
|
||||||
slugify(self._light.device_info.manufacturer))
|
|
||||||
if features:
|
|
||||||
return features
|
|
||||||
return SUPPORTED_FEATURES
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -92,7 +90,6 @@ class Tradfri(Light):
|
|||||||
@property
|
@property
|
||||||
def rgb_color(self):
|
def rgb_color(self):
|
||||||
"""RGB color of the light."""
|
"""RGB color of the light."""
|
||||||
if self.supported_features & SUPPORT_RGB_COLOR:
|
|
||||||
return self._rgb_color
|
return self._rgb_color
|
||||||
|
|
||||||
def turn_off(self, **kwargs):
|
def turn_off(self, **kwargs):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user