1
mirror of https://github.com/home-assistant/core synced 2024-09-28 03:04:04 +02:00

Tweak Tradfri (#7172)

This commit is contained in:
Paulus Schoutsen 2017-04-19 09:15:39 -07:00 committed by GitHub
parent 90baa2ce4d
commit 1a635fede3

View File

@ -46,17 +46,15 @@ class Tradfri(Light):
self._light_data = light.light_control.lights[0]
self._name = light.name
self._rgb_color = None
self._features = ALLOWED_FEATURES.get(
slugify(self._light.device_info.manufacturer), SUPPORTED_FEATURES)
self._ok_temps = ALLOWED_TEMPERATURES.get(
slugify(self._light.device_info.manufacturer))
@property
def supported_features(self):
"""Flag supported features."""
features = ALLOWED_FEATURES.get(
slugify(self._light.device_info.manufacturer))
if features:
return features
return SUPPORTED_FEATURES
return self._features
@property
def name(self):
@ -92,7 +90,6 @@ class Tradfri(Light):
@property
def rgb_color(self):
"""RGB color of the light."""
if self.supported_features & SUPPORT_RGB_COLOR:
return self._rgb_color
def turn_off(self, **kwargs):