Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewListLightsHandler ¶
func NewListLightsHandler(bridgesProvider pkg.BridgesProvider) libhttp.WithError
NewListLightsHandler returns a JSON handler that lists all lights on the first bridge known to the BridgesProvider.
func NewSetLogLevelHandler ¶ added in v0.5.0
func NewSetLogLevelHandler( levelVar *slog.LevelVar, defaultLevel slog.Level, autoResetDuration time.Duration, ) http.Handler
NewSetLogLevelHandler returns a handler for the /setloglevel/{level} route. The numeric level segment is validated (0-10) and mapped onto the given slog LevelVar (0 -> Info, >=1 -> Debug); invalid input yields a 400 response and leaves the level unchanged. Unless the level was re-set in the meantime, it auto-resets to defaultLevel after autoResetDuration.
func NewStatusHandler ¶
func NewStatusHandler(bridgesProvider pkg.BridgesProvider) libhttp.WithError
NewStatusHandler returns a JSON handler that splits the lights on the first bridge into on/off name lists, sorted for stable output.
Types ¶
type StatusResponse ¶
StatusResponse is a scannable summary of which lights are currently on and off across the first bridge known to the BridgesProvider.