Moved payloads out of their own package because it made the API less nice.

This commit is contained in:
Sam Rose
2019-07-14 21:52:11 +01:00
parent 8ee19c457a
commit b94be0cf1e
5 changed files with 39 additions and 45 deletions

View File

@ -9,8 +9,6 @@ import (
"os"
"time"
"github.com/samwho/streamdeck/payload"
"github.com/samwho/streamdeck"
sdcontext "github.com/samwho/streamdeck/context"
"github.com/shirou/gopsutil/cpu"
@ -88,12 +86,12 @@ func setup(client *streamdeck.Client) {
continue
}
if err := client.SetImage(ctx, img, payload.HardwareAndSoftware); err != nil {
if err := client.SetImage(ctx, img, streamdeck.HardwareAndSoftware); err != nil {
log.Printf("error setting image: %v\n", err)
continue
}
if err := client.SetTitle(ctx, fmt.Sprintf("CPU\n%d%%", int(r[0])), payload.HardwareAndSoftware); err != nil {
if err := client.SetTitle(ctx, fmt.Sprintf("CPU\n%d%%", int(r[0])), streamdeck.HardwareAndSoftware); err != nil {
log.Printf("error setting title: %v\n", err)
continue
}