There are two APIs you can use to manipulate the Holiday: the RESTful API, which has a bunch of methods or the SecretAPI, which uses crafted UDP packages to paint colours onto the Holiday light string directly. While the RESTful API has more functionality, the SecretAPI is much, much faster.
You can find a PHP class library to access the Holiday via the SecretAPI at https://github.com/Djelibeybi/PHP-Holiday-SecretAPI. Sample scripts are provided as well.
Bug reports, pull requests, comments welcome.
Currently, the following methods are defined:
setglobe($globenum, $r, $g, $b)
- Sets the globe with number
$globenum
(base 0 to 49) to the colour represented by$r
,$g
and$b
. fill($r, $g, $b)
- Fills the entire string, i.e. all globes, with the same colour represented by
$r
,$g
and$b
. getglobe($globenum)
- Returns an array of the RGB colour values for the globe with the number
$globenum
as represented internally within the object. Note that the SecretAPI doesn’t have a query mechanism, so we can’t actually retrieve the currently active value for the globe. This is the value we think the globe is. render()
- This crafts the 160-byte UDP packet and paints the current state of the globes onto the Holiday. Used after calling
fill()
orsetglobe()
to paint the values onto the light(s).