light_manager module

class light_manager.LightManager(enable_interactions=True)

Bases: object

check_light_interaction()

Check for sudden light changes indicating user interaction. Uses adaptive baseline that normalizes to ambient light over time. Only works if interactions are enabled.

Returns:

(interaction_detected, light_change, current_light)

get_current_light_level()

Get the current light sensor reading.

reset_light_history()

Reset light interaction history.

update_brightness_for_ambient_light(pixels)

Automatically adjust LED brightness based on ambient light. Uses proportional scaling with min/max bounds for better adaptation.

Parameters:

pixels – NeoPixel object to adjust brightness on

Returns:

Current light sensor reading

Return type:

current_light