|
|
@ -20,12 +20,10 @@ func main() { |
|
|
|
resolver := services.NewResolver() |
|
|
|
sceneMap := services.NewSceneMap(resolver) |
|
|
|
|
|
|
|
bus.Join(resolver) |
|
|
|
bus.Join(sceneMap) |
|
|
|
bus.JoinPrivileged(resolver) |
|
|
|
bus.JoinPrivileged(sceneMap) |
|
|
|
bus.Join(services.NewEffectEnforcer(resolver, sceneMap)) |
|
|
|
|
|
|
|
time.Sleep(time.Millisecond) |
|
|
|
|
|
|
|
bus.RunEvent(events.Connected{Prefix: "nanoleaf:10.80.1.11"}) |
|
|
|
|
|
|
|
numbers := []int{5, 2, 3, 1, 4} |
|
|
@ -39,22 +37,16 @@ func main() { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
time.Sleep(time.Millisecond) |
|
|
|
|
|
|
|
bus.RunCommand(commands.ReplaceScene{ |
|
|
|
Match: "lucifer:name:Hex*", |
|
|
|
SceneID: 7, |
|
|
|
}) |
|
|
|
|
|
|
|
time.Sleep(time.Millisecond) |
|
|
|
|
|
|
|
bus.RunCommand(commands.AddAlias{ |
|
|
|
Match: "nanoleaf:10.80.1.{11,7,16,5}:*", |
|
|
|
Alias: "lucifer:tag:Magic Lamps", |
|
|
|
}) |
|
|
|
|
|
|
|
time.Sleep(time.Millisecond) |
|
|
|
|
|
|
|
for i, id := range []string{"40e5", "dead", "beef", "cafe", "1337"} { |
|
|
|
bus.RunEvent(events.HardwareState{ |
|
|
|
ID: "nanoleaf:10.80.1.11:" + id, |
|
|
@ -65,8 +57,6 @@ func main() { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
time.Sleep(time.Millisecond) |
|
|
|
|
|
|
|
bus.RunEvent(events.ExternalEvent{ |
|
|
|
Kind: "weather", |
|
|
|
Values: map[string]string{ |
|
|
@ -76,8 +66,6 @@ func main() { |
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
|
time.Sleep(time.Millisecond) |
|
|
|
|
|
|
|
c1 := gentools.Ptr(color.MustParse("rgb:#ff0000")) |
|
|
|
c2 := gentools.Ptr(color.MustParse("rgb:#00ff00")) |
|
|
|
bus.RunCommand(commands.Assign{ |
|
|
@ -100,8 +88,6 @@ func main() { |
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
|
time.Sleep(time.Millisecond * 100) |
|
|
|
|
|
|
|
log.Println("Search \"**:Hexagon {1,5,6}\"") |
|
|
|
for _, dev := range resolver.Resolve("lucifer:name:Hexagon {1,5,6}") { |
|
|
|
log.Println("- ID:", dev.ID) |
|
|
|