Light Entity

A light entity is a device that controls the brightness, RGB value,color temperature and effects of a light source.

Properties

NameTypeDefaultDescription
brightnessintNoneReturn the brightness of this light between 0..255
color_tempintNoneReturn the CT color value in mireds.
effectStringNoneReturn the current effect.
effect_listlistNoneReturn the list of supported effects.
hs_colorlistNoneReturn the hue and saturation color value [float, float].
is_onboolboolReturns if the light entity is on or not.
max_minredsintintReturn the warmest color_temp that this light supports.
min_miredsintintReturn the coldest color_temp that this light supports.
supported_featuresintintFlag supported features.
white_valueintNoneReturn the white value of this light between 0..255.

Support Feature

ConstantDescription
SUPPORT_BRIGHTNESSControls the brightness of a light source
SUPPORT_COLORControls the color a light source shows
SUPPORT_COLOR_TEMPControls the representation a light source shows based on temperature
SUPPORT_EFFECTControls the effect a light source shows
SUPPORT_FLASHControls the duration of a flash a light source shows
SUPPORT_TRANSITIONControls the duration of transitions between color and effects
SUPPORT_WHITE_VALUEControls the white light a light source shows.

Methods

Turn on Light Device

class MyLightDevice(LightDevice):
def turn_on(self, **kwargs):
"""Turn the device on."""
async def async_turn_on(self, **kwargs):
"""Turn device on."""

Turn Off Light Device

class MyLightDevice(LightDevice):
def turn_off(self, **kwargs):
"""Turn the device off."""
async def async_turn_off(self, **kwargs):
"""Turn device off."""