Classes

Strategies

class wluma_als_emulator.strategies.webcam_strategy.WebcamStrategy(config)[source]
calculate()[source]

Fetch the brighness WEBCAM_PROBES time And return the average

get_brighness(screenshot_cmd)[source]

Return brighness from a webcam capture

get_sleep_time()[source]

Return how many time to sleep between two loop

class wluma_als_emulator.strategies.noon_strategy.NoonStrategy(config)[source]
class wluma_als_emulator.strategies.time_strategy.TimeStrategy(config)[source]
class wluma_als_emulator.strategies.daylight_strategy.DayLightStrategy(config)[source]

Core

Helpers

class wluma_als_emulator.helpers.solar_api.SolarApi(config)[source]

Fetch informations related to the solar rotation around the earth from https://sunrise-sunset.org/

convert_data(data)[source]

Extend api data with some needed converted data

fetch()[source]

Get data from the api plus some converted data

time_in_seconds(data)[source]

Convert a datetime to seconds since the start of the day

time_to_localtime(data)[source]

Convert from a time UTC to a datetime in locale TZ a format like “08:42:01 PM”