Fix sensor code.
This commit is contained in:
parent
2a61dc6777
commit
f5e80f3687
2 changed files with 8 additions and 6 deletions
|
@ -4,7 +4,9 @@ function buildSensorList {
|
|||
local sList is Lexicon().
|
||||
list SENSORS in SensorList.
|
||||
for s in SensorList {
|
||||
sList:add(s:type, s).
|
||||
if not sList:HasKey(s:type) {
|
||||
sList:add(s:type, s).
|
||||
}
|
||||
}
|
||||
return sList.
|
||||
}
|
||||
|
@ -22,5 +24,5 @@ function ReadSensor {
|
|||
if not sList:HasKey(s) {
|
||||
return -1. // TODO: is -1 an impossible result for all sensors? I suspect not...
|
||||
}
|
||||
return sList[s].
|
||||
return s:DISPLAY:TOSCALAR.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue