Light

class knut.services.light.Light(location, uid, room)

Base class for light services.

The light has an uid and location within a room.

If the state of the light changes, e.g. when calling status_setter(), the method on_change() is called with the uid as argument. Any listener can register upon this event.

color = None

The light color as hex code e.g. #000000.

color_cold = None

A color that represents the light when the temperature is 0.

color_warm = None

A color that represents the light when the temperature is 100.

dimlevel = None

The dimlevel as percentage value where at 0 the light is off and 100, it’s full on.

location = None

The location inside a room.

room = None

The room in which the light is located.

state = None

The state of the light as boolean.

status_setter(status)

Applies the status to the back-end.

The status dictionary must have 'state' as key and can have the following keys additional:

temperature = None

The light temperature as percentage value where 0 is the coldest and 100 the warmest color temperature.

uid = None

The unique identifier used by the Knut system.