ColorTemperatureLight

These lights behave like DimmableLight, but they allow setting a color temperature for their light.

class huegely.lights.ColorTemperatureLight(bridge, device_id, name=None, transition_time=None)[source]

Bases: huegely.features.Dimmer, huegely.features.TemperatureController, huegely.lights.Light

alert(alert=None)

Returns the current alert value if called without alert argument, otherwise sets and returns the new alert.

The only currently supported alerts are ‘none’ and ‘select’.

Note that alerts currently seem to be broken, or at least weird, in the hue api. Setting a select alert will blink a light once, but the alert state will stay on “select” until manually reset.

brighter(step=25, transition_time=None)

Makes the light(s) gradually brighter. Turns light on if necessary.

Returns new brightness value.

brightness(brightness=None, transition_time=None)

Returns the current brightness level if called without brightness argument, otherwise sets and returns the new value.

The valid range for brightness values is 0 - 254, passed-in values are clamped to that range.

darker(step=25, transition_time=None)

Makes the light(s) gradually darker. Turns off if the brightness goes down to 0.

Returns the new brightness value.

is_on()

Returns True if the light(s) is on, False otherwise.

is_reachable()

Returns True if the light is currently reachable, False otherwise.

name(name=None)

Gets or sets the current name of the group. If called without name argument, returns the current group name.

If called with a name argument, sets and returns the new name of the group.

off(transition_time=None)

Turns light(s) off. Returns new state (False).

on(transition_time=None)

Turns light(s) on. Returns new state (True).

state(**state)

Gets or sets state attributes. Call this without any arguments to get the entire state as reported by the Hue bridge. Note that the state reported by groups is unreliable - the values mostly seem to have no relation to the real lights. It is sometimes necessary to get the state though, especially when using the brighter/darker commands.

Pass in any amount of state attributes to update them, e.g. on=True, brighter=50.

Returns a dictionary of successfully updated attributes in the format of {'brightness': 100, 'on': True}

temperature(temperature=None, transition_time=None)

Returns the current color temperature (in mireds) if called without temperature argument, otherwise sets and returns the new value.

The valid range for color temperatures is 154 - 500, passed-in values are clamped to that range.

transition_time