Skip to content

Web API to get values to set light color and brightness

Notifications You must be signed in to change notification settings

castus/lights-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is an API to serve values based on time. These values are then used by LED Controllers to dim lights and set a specific color.

How it works?

Brightness and color are values from 0 to 1000. This repo uses simple linear function that increase that number from midnight to noon and then decrease it until midnight.

        ▲
   1000 │                                ┌─┐
        │                              ┌─┘ └─┐
        │                            ┌─┘     └─┐
        │                          ┌─┘         └─┐
        │                        ┌─┘             └─┐
        │                      ┌─┘                 └─┐
        │                    ┌─┘                     └─┐
        │                  ┌─┘                         └─┐
        │                ┌─┘                             └─┐
        │              ┌─┘                                 └─┐
        │            ┌─┘                                     └─┐
        │          ┌─┘                                         └─┐
        │        ┌─┘                                             └─┐
        │      ┌─┘                                                 └─┐
        │    ┌─┘                                                     └─┐
        │  ┌─┘                                                         └─┐
      0 │┌─┘                                                             └─┐
        └┴─────────────────────────────────────────────────────────────────┴─▶
         midnight                        noon                        midnight

About

Web API to get values to set light color and brightness

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published