mirror of
https://github.com/Manuel83/craftbeerpi3
synced 2026-08-10 02:55:27 +02:00
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.
This commit is contained in:
@@ -173,7 +173,7 @@ class SensorAPI(object):
|
|||||||
def get_sensor_value(self, id):
|
def get_sensor_value(self, id):
|
||||||
try:
|
try:
|
||||||
id = int(id)
|
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:
|
except Exception as e:
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user