Base Classes

These are the bases which all light/group classes are built upon. Each class describes the behaviour of one specific light feature-set, which are mixed and matched in different hue lights.

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

Abstract base class for all lights. All lights inherit from Light and any appropriate feature classes.

bridge - Instance of huegely.Bridge this light belongs to
light_id - Identifier for this light in the hue bridge
is_reachable()[source]

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

class huegely.groups.Group(bridge, device_id, name=None, transition_time=None)[source]
bridge - Instance of huegely.Bridge this group belongs to
group_id - Identifier for this group in the hue bridge
group_type()[source]

Get the type of group (light group or room)

lights()[source]

Returns all lights that belong to this group.

class huegely.features.Dimmer(bridge, device_id, name=None, transition_time=None)[source]

Abstract base class for devices that allow dimming (which is all Hue devices currently being sold.)

alert(alert=None)[source]

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)[source]

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

Returns new brightness value.

brightness(brightness=None, transition_time=None)[source]

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)[source]

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

Returns the new brightness value.

is_on()[source]

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

off(transition_time=None)[source]

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

on(transition_time=None)[source]

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

class huegely.features.ColorController(bridge, device_id, name=None, transition_time=None)[source]

Abstract base class for colored lights.

color_mode()[source]

Returns the current color_mode value (xy or ct).

Note that this has only been tested on an ExtendedColorLight, because I don’t have others. It might not work on ColorLights or ColorTemperatureLights.

coordinates(coordinates=None, transition_time=None)[source]

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

coordinates is expected to be in the format of [x (float), y (float)].

The valid range for each coordinate is 0 - 1, passed-in values are clamped to that range.

Note that each lamp’s color space is different and will choose the color coordinate they can reproduce closest to the requested value. See http://www.developers.meethue.com/documentation/core-concepts for details.

effect(effect=None)[source]

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

The only currently supported effects are ‘none’ and ‘colorloop’.

hue(hue=None, transition_time=None)[source]

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

The valid range for hues is 0 - 65534, passed-in values are cycled over that range. I.e. hue(65535) (red) is equal to hue(0) (also red).

saturation(saturation=None, transition_time=None)[source]

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

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

class huegely.features.TemperatureController(bridge, device_id, name=None, transition_time=None)[source]

Abstract base class for lights that allow setting a color temperature for their white light.

temperature(temperature=None, transition_time=None)[source]

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.