-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.go
26 lines (21 loc) · 819 Bytes
/
base.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package action
import (
"github.com/Doridian/go-streamdeck"
"github.com/Doridian/streamdeckpi/agent/internal/controller"
"gopkg.in/yaml.v3"
)
type Action interface {
New() Action
// When ApplyConfig is called, apply config
// Your struct is expected to declare exported fields with YAML annotation
// for config values
ApplyConfig(config *yaml.Node, imageHelper controller.ImageHelper, ctrl controller.Controller) error
Run(pressed bool) error
Name() string
// In Render, you can return a nil image to indicate the image hasn't changed since the last call
// This will indicate to the renderer to not change the image
//
// If force is true, you must always return an image if the action has one available
// Otherwsie, a blank image will be set
Render(force bool) (*streamdeck.ImageData, error)
}