|
@ -27,24 +27,37 @@ func main() { |
|
|
switch event.(type) { |
|
|
switch event.(type) { |
|
|
case events.DevicesReady: |
|
|
case events.DevicesReady: |
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:2d0c", Alias: "lucifer:name:Hex 5"}) |
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:2d0c", Alias: "lucifer:name:Hex 5"}) |
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:542f", Alias: "lucifer:name:Hex 4"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:e760", Alias: "lucifer:name:Hex 3"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:207a", Alias: "lucifer:name:Hex 2"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:df9a", Alias: "lucifer:name:Hex 1"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:cdd5", Alias: "lucifer:name:Hex 6"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:4597", Alias: "lucifer:name:Hex 7"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:82cb", Alias: "lucifer:name:Hex 8"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:09fd", Alias: "lucifer:name:Hex 9"}) |
|
|
|
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:542f", Alias: "lucifer:name:Hex 6"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:e760", Alias: "lucifer:name:Hex 7"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:207a", Alias: "lucifer:name:Hex 8"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:df9a", Alias: "lucifer:name:Hex 9"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:cdd5", Alias: "lucifer:name:Hex 4"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:4597", Alias: "lucifer:name:Hex 3"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:82cb", Alias: "lucifer:name:Hex 2"}) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:09fd", Alias: "lucifer:name:Hex 1"}) |
|
|
bus.RunCommand(commands.Assign{ |
|
|
bus.RunCommand(commands.Assign{ |
|
|
Match: "nanoleaf:10.80.1.14:*", |
|
|
Match: "nanoleaf:10.80.1.14:*", |
|
|
Effect: effects.Gradient{ |
|
|
|
|
|
|
|
|
Effect: effects.Pattern{ |
|
|
States: []device.State{ |
|
|
States: []device.State{ |
|
|
{Power: p(true), Intensity: p(0.3), Color: p(color.MustParse("xy:0.22,0.18"))}, |
|
|
{Power: p(true), Intensity: p(0.3), Color: p(color.MustParse("xy:0.22,0.18"))}, |
|
|
|
|
|
{Power: p(true), Intensity: p(0.4), Color: p(color.MustParse("xy:0.22,0.18"))}, |
|
|
|
|
|
{Power: p(true), Intensity: p(0.5), Color: p(color.MustParse("xy:0.22,0.18"))}, |
|
|
|
|
|
}, |
|
|
|
|
|
AnimationMS: 200, |
|
|
|
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
time.Sleep(time.Second * 3) |
|
|
|
|
|
bus.RunCommand(commands.AddAlias{Match: "nanoleaf:10.80.1.14:*", Alias: "lucifer:tag:Magic Lamps"}) |
|
|
|
|
|
bus.RunCommand(commands.Assign{ |
|
|
|
|
|
Match: "lucifer:tag:Magic Lamps", |
|
|
|
|
|
Effect: effects.Gradient{ |
|
|
|
|
|
States: []device.State{ |
|
|
{Power: p(true), Intensity: p(0.5), Color: p(color.MustParse("xy:0.22,0.18"))}, |
|
|
{Power: p(true), Intensity: p(0.5), Color: p(color.MustParse("xy:0.22,0.18"))}, |
|
|
|
|
|
{Power: p(true), Intensity: p(0.8), Color: p(color.MustParse("xy:0.22,0.18"))}, |
|
|
}, |
|
|
}, |
|
|
Interpolate: true, |
|
|
Interpolate: true, |
|
|
AnimationMS: 1000, |
|
|
|
|
|
Reverse: false, |
|
|
|
|
|
|
|
|
AnimationMS: 500, |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -56,7 +69,7 @@ func main() { |
|
|
|
|
|
|
|
|
bus.RunCommand(commands.ConnectDevice{ |
|
|
bus.RunCommand(commands.ConnectDevice{ |
|
|
ID: "nanoleaf:10.80.1.14", |
|
|
ID: "nanoleaf:10.80.1.14", |
|
|
APIKey: "", |
|
|
|
|
|
|
|
|
APIKey: "QRj5xcQxAQMQsjK4gvaprdhOwr1sCIcj", |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
time.Sleep(time.Hour) |
|
|
time.Sleep(time.Hour) |
|
|