debug function for message type
All checks were successful
build rgb-board / build (push) Successful in 8m34s
All checks were successful
build rgb-board / build (push) Successful in 8m34s
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
b64 "encoding/base64"
|
b64 "encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"log"
|
"log"
|
||||||
@@ -105,6 +106,7 @@ func (a *Animation) Next() (image.Image, <-chan time.Time, error) {
|
|||||||
select {
|
select {
|
||||||
case msg := <-a.mqmsg:
|
case msg := <-a.mqmsg:
|
||||||
json.Unmarshal([]byte(string(msg.Payload())), &incoming)
|
json.Unmarshal([]byte(string(msg.Payload())), &incoming)
|
||||||
|
fmt.Println(incoming.Type)
|
||||||
if incoming.Type == "doorbell" {
|
if incoming.Type == "doorbell" {
|
||||||
a.msg = string(msg.Payload())
|
a.msg = string(msg.Payload())
|
||||||
a.ctx.DrawString(a.msg, 5, 9)
|
a.ctx.DrawString(a.msg, 5, 9)
|
||||||
|
|||||||
Reference in New Issue
Block a user