pred_brain.exp.hue#

Minimal Philips Hue Bridge client.

The bridge connection, light listing, and light control use API v2. Light discovery uses the legacy API v1 endpoint because the v2 device resource endpoint is not the light-search command.

Endpoints:

  • GET /clip/v2/resource/bridge verifies the bridge connection.

  • POST /api/<application_key>/lights starts light discovery (API v1).

  • GET /api/<application_key>/lights/new returns the latest discovery result (API v1).

  • GET /clip/v2/resource/light lists lights (API v2).

exception pred_brain.exp.hue.HueBridgeError#

Raised when the Hue Bridge cannot be contacted or rejects a request.

pred_brain.exp.hue.load_hue_mapping(filepath: str) → dict[str, str]#

Load a light-location mapping from a CSV file.

pred_brain.exp.hue.save_hue_mapping(filepath: str, mapping: dict[str, str]) → None#

Save a light-location mapping to a CSV file.

pred_brain.exp.hue.discover_and_list_lights() → None#

Discover and print the lights known by the configured bridge.

pred_brain.exp.hue.map_lights_interactive() → None#

Map lights to locations interactively by turning them off one at a time.