Welcome to uvhue’s documentation!

A hue client for uvhttp.

class uvhue.uvhue.Hue(loop, hue_api, **kwargs)

Hue client for uvhttp.

api(method, path, *args, **kwargs)

Make an API request to hue with the given path.

The path should be everything except for the common part of the URL.

For example, https://hue/api/1209310239/lights becomes /lights.

hue_api

Return the Hue API to use for requests.

hue_id

The hue id that will be used when interacting with the API.

lights(refresh=False)

Return all of the lights in the system. It will be served from cache, if available, if the refresh parameter is not False.

Link with a hue bridge. Return a user id that can be used.

set_state(light, state)

Set a state for a light.

set_states(state, refresh=False)

Set a state for all lights.

You can use the rgb module to convert rgb colors to the xz colors that hue expects:

uvhue.rgb.decimal_to_xyz(rgb)

Convert decimal format to xyz

uvhue.rgb.gamma_correct(color)

Gamma correct a single color in your rgb tuple.

uvhue.rgb.gamma_correct_rgb(rgb)

Gamma correct rgb colors.

uvhue.rgb.is_grey(rgb, threshold=20)

Return true if an rgb color is a shade of grey.

uvhue.rgb.rgb_to_decimal(rgb)

Convert rgb format to decimal.

uvhue.rgb.rgb_to_xy(rgb)

Convert a tuple of rgb colors to xy.

uvhue.rgb.xyz_to_xy(xyz)

Convert xyz tuple to xy

Indices and tables