Skip to content

Commit

Permalink
fix: create config
Browse files Browse the repository at this point in the history
  • Loading branch information
slntopp committed Feb 9, 2024
1 parent 77dd79a commit efbad70
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func main() {
panic(err)
}

config_path := path.Join(home, ".default.infinimesh.yaml")
config_path := path.Join(home, ".app.infinimesh.yaml")
fmt.Printf("Config used from path: %s\n", config_path)

config_bytes, err := os.ReadFile(config_path)
Expand Down Expand Up @@ -210,15 +210,20 @@ skip_cleanup:
}(res.GetDevice())

if i == 0 {
config, _ := structpb.NewStruct(map[string]interface{}{
config, err := structpb.NewStruct(map[string]interface{}{
"infinimesh.timeseries": map[string]interface{}{
"enabled": true,
"include_metrics": []string{
"include_metrics": []interface{}{
"speed",
"sats",
},
},
})
if err != nil {
fmt.Printf("Error creating config: %v\n", err)
return
}

_, err = devc.PatchConfig(ctx, &devpb.Device{
Uuid: res.GetDevice().GetUuid(),
Config: config,
Expand Down

0 comments on commit efbad70

Please sign in to comment.