func SensorValue()

in cli/api/entity_sensors/sensors.go [28:42]


func SensorValue(network *net.Network, application, entity, sensor string) (interface{}, error) {
	url := fmt.Sprintf("/v1/applications/%s/entities/%s/sensors/%s", application, entity, sensor)
	body, err := network.SendGetRequest(url)
	if nil != err || 0 == len(body) {
		return nil, err
	}

	var value interface{}
	err = json.Unmarshal(body, &value)
	if nil != err {
		return nil, err
	}

	return value, nil
}