Skip to content
Permalink
Browse files

don't include ID on all samples

  • Loading branch information...
cbrake committed Sep 5, 2019
1 parent b476268 commit 27cfdef3f47ed1e0e1480290d9d94c0323fcee47
Showing with 8 additions and 2 deletions.
  1. +8 −2 sim/device.go
@@ -19,11 +19,11 @@ func DeviceSim(portal, deviceID string) {
sendSamples := api.NewSendSamples(portal, false)
tempSim := NewSim(72, 0.2, 70, 75)
voltSim := NewSim(2, 0.1, 1, 5)
voltSim2 := NewSim(5, 0.5, 1, 10)

for {
samples := make([]data.Sample, 2)
samples := make([]data.Sample, 3)
samples[0] = data.Sample{
ID: "T0",
Type: "temp",
Value: tempSim.Sim(),
}
@@ -34,6 +34,12 @@ func DeviceSim(portal, deviceID string) {
Value: voltSim.Sim(),
}

samples[2] = data.Sample{
ID: "V1",
Type: "volt",
Value: voltSim2.Sim(),
}

err := sendSamples(deviceID, samples)
if err != nil {
log.Println("Error sending samples: ", err)

0 comments on commit 27cfdef

Please sign in to comment.
You can’t perform that action at this time.