HomeKit controller light - remove code that can never execute (#21951)

This commit is contained in:
Jc2k
2019-03-13 19:53:33 +00:00
committed by Paulus Schoutsen
parent eed1168fa1
commit deb66bb748

View File

@@ -25,11 +25,11 @@ class HomeKitLight(HomeKitEntity, Light):
def __init__(self, *args): def __init__(self, *args):
"""Initialise the light.""" """Initialise the light."""
super().__init__(*args) super().__init__(*args)
self._on = None self._on = False
self._brightness = None self._brightness = 0
self._color_temperature = None self._color_temperature = 0
self._hue = None self._hue = 0
self._saturation = None self._saturation = 0
def get_characteristic_types(self): def get_characteristic_types(self):
"""Define the homekit characteristics the entity cares about.""" """Define the homekit characteristics the entity cares about."""
@@ -78,23 +78,17 @@ class HomeKitLight(HomeKitEntity, Light):
@property @property
def brightness(self): def brightness(self):
"""Return the brightness of this light between 0..255.""" """Return the brightness of this light between 0..255."""
if self._features & SUPPORT_BRIGHTNESS:
return self._brightness * 255 / 100 return self._brightness * 255 / 100
return None
@property @property
def hs_color(self): def hs_color(self):
"""Return the color property.""" """Return the color property."""
if self._features & SUPPORT_COLOR:
return (self._hue, self._saturation) return (self._hue, self._saturation)
return None
@property @property
def color_temp(self): def color_temp(self):
"""Return the color temperature.""" """Return the color temperature."""
if self._features & SUPPORT_COLOR_TEMP:
return self._color_temperature return self._color_temperature
return None
@property @property
def supported_features(self): def supported_features(self):