From f1ec635f2585fb129d18c680973418df9befc766 Mon Sep 17 00:00:00 2001 From: IndyJoeA Date: Fri, 23 Jun 2017 22:47:05 -0400 Subject: [PATCH] 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. --- modules/core/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/core.py b/modules/core/core.py index 1caf28a..623ce2f 100644 --- a/modules/core/core.py +++ b/modules/core/core.py @@ -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