hottisScd30
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
package hottisScd30
|
package hottisScd30
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
//"log"
|
||||||
"fmt"
|
"fmt"
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
@ -35,23 +35,23 @@ func Parse(fPort int, _ []byte, frmPayload string, variables *map[string]databas
|
|||||||
var co2concentration float32 = float32(values.CO2Conc) / 100;
|
var co2concentration float32 = float32(values.CO2Conc) / 100;
|
||||||
var temperature float32 = float32(values.Temp) / 100;
|
var temperature float32 = float32(values.Temp) / 100;
|
||||||
var humidity float32 = float32(values.Hum) / 100;
|
var humidity float32 = float32(values.Hum) / 100;
|
||||||
log.Printf("CO2: %f, Temp: %f, Hum: %f, Status: %d", co2concentration, temperature, humidity, values.Status)
|
// log.Printf("CO2: %f, Temp: %f, Hum: %f, Status: %d", co2concentration, temperature, humidity, values.Status)
|
||||||
|
|
||||||
(*variables)["co2concentration"] = database.VariableType {
|
(*variables)["CO2concentration"] = database.VariableType {
|
||||||
Label: "co2concentration",
|
Label: "CO2concentration",
|
||||||
Variable: "concentration",
|
Variable: "Concentration",
|
||||||
Unit: "ppm",
|
Unit: "ppm",
|
||||||
Value: co2concentration,
|
Value: co2concentration,
|
||||||
}
|
}
|
||||||
(*variables)["temperature"] = database.VariableType {
|
(*variables)["Temperature"] = database.VariableType {
|
||||||
Label: "temperature",
|
Label: "Temperature",
|
||||||
Variable: "temperature",
|
Variable: "Temperature",
|
||||||
Unit: "°C",
|
Unit: "°C",
|
||||||
Value: temperature,
|
Value: temperature,
|
||||||
}
|
}
|
||||||
(*variables)["humidity"] = database.VariableType {
|
(*variables)["Humidity"] = database.VariableType {
|
||||||
Label: "humidity",
|
Label: "Humidity",
|
||||||
Variable: "humidity",
|
Variable: "Humidity",
|
||||||
Unit: "%",
|
Unit: "%",
|
||||||
Value: humidity,
|
Value: humidity,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user