update example

This commit is contained in:
Daniel Prows 2023-08-08 16:11:05 -06:00
parent afaa02f8b2
commit d0611bfa49

View File

@ -50,7 +50,7 @@ func setup(client *streamdeck.Client) {
settings := make(map[string]*Settings) settings := make(map[string]*Settings)
action.RegisterHandler(streamdeck.WillAppear, func(ctx context.Context, client *streamdeck.Client, event streamdeck.Event) error { action.RegisterHandler(streamdeck.WillAppear, func(ctx context.Context, client *streamdeck.Client, event streamdeck.Event) error {
p := streamdeck.WillAppearPayload{} p := streamdeck.WillAppearPayload[Settings]{}
if err := json.Unmarshal(event.Payload, &p); err != nil { if err := json.Unmarshal(event.Payload, &p); err != nil {
return err return err
} }
@ -61,9 +61,11 @@ func setup(client *streamdeck.Client) {
settings[event.Context] = s settings[event.Context] = s
} }
/*
if err := json.Unmarshal(p.Settings, s); err != nil { if err := json.Unmarshal(p.Settings, s); err != nil {
return err return err
} }
*/
bg, err := streamdeck.Image(background()) bg, err := streamdeck.Image(background())
if err != nil { if err != nil {