load v01 config

This commit is contained in:
bel
2023-03-25 00:30:13 -06:00
parent 6289222b69
commit c83f9d8700
3 changed files with 14 additions and 0 deletions

View File

@@ -2,10 +2,13 @@ package button
import (
"encoding/json"
"io/ioutil"
"log"
"mayhem-party/src/device/input/raw"
"os"
"time"
"gopkg.in/yaml.v2"
)
var debugging = os.Getenv("DEBUG") == "true"
@@ -13,6 +16,7 @@ var debugging = os.Getenv("DEBUG") == "true"
type (
V01 struct {
src raw.Raw
cfg v01Cfg
}
v01Msg struct {
T int64
@@ -20,11 +24,17 @@ type (
Y string
N string
}
v01Cfg struct {
}
)
func NewV01(src raw.Raw) V01 {
var cfg v01Cfg
b, _ := ioutil.ReadFile(os.Getenv("BUTTON_PARSER_V01_CONFIG"))
yaml.Unmarshal(b, &cfg)
return V01{
src: src,
cfg: cfg,
}
}