Example #1
0
func UpdateSensors(c gossamer.Client) {
	l, err := c.QuerySensors().Top(1).All()
	if err != nil {
		log.Fatal(err)
	}

	var o gossamer.Sensor
	if len(l) > 0 {
		o = l[0].(gossamer.Sensor)

		n := gossamer.CloneSensorEntity(o)
		n.Description = "Updated description"

		err = c.UpdateSensor(n)
		if err != nil {
			log.Fatal(err)
		}
	}
}