Pārlūkot izejas kodu

Replace int with float in get_sensor_value()

I've noticed that sensor values are being handled as integers by this function, which was causing poor performance of the PIDArduino logic and another logic plugin I am testing.  I have changed the type to float, and now logic controllers can receive more accurate temperature values.
tags/3.1_alpha
IndyJoeA GitHub pirms 8 gadiem
vecāks
revīzija
f1ec635f25
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. +1
    -1
      modules/core/core.py

+ 1
- 1
modules/core/core.py Parādīt failu

@@ -173,7 +173,7 @@ class SensorAPI(object):
def get_sensor_value(self, id):
try:
id = int(id)
return int(self.cache.get("sensors")[id].instance.last_value)
return float(self.cache.get("sensors")[id].instance.last_value)
except Exception as e:

return None


Notiek ielāde…
Atcelt
Saglabāt