forgot to convert the value
This commit is contained in:
parent
70cde17508
commit
7ecb3ff21c
@ -84,17 +84,27 @@ func startCacheService(t *TH7Adapter) {
|
||||
cjc_uv, err := thermocouple.UV(tc, pcb_temperature)
|
||||
if err != nil {
|
||||
log.Println("Error doing CJC", err)
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
|
||||
data[k].Value -= cjc_uv
|
||||
data[k].Unit = t.cfg.Channels[k].Unit
|
||||
}
|
||||
|
||||
} else {
|
||||
// CJC can not be applied
|
||||
// board temp out of range for specified thermocouple type
|
||||
// perhaps just subtract board temperature? dont know
|
||||
fmt.Println("No valid CJC", t.cfg.Channels[k])
|
||||
}
|
||||
|
||||
new_value_c, err := thermocouple.C(tc, data[k].Value)
|
||||
if err != nil {
|
||||
log.Println("Error converting UV to C", t.cfg.Channels[k], data[k].Value)
|
||||
}
|
||||
|
||||
data[k].Value = new_value_c
|
||||
|
||||
//TODO: different temp units
|
||||
}
|
||||
|
||||
t.mu.Lock()
|
||||
|
Loading…
Reference in New Issue
Block a user