summaryrefslogtreecommitdiffstats
path: root/pytools
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2016-06-24 09:09:29 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2016-06-24 13:17:29 -0400
commit8e5354ea40d562819c1f5749572dc3e1f975ef67 (patch)
treebfd15dfe4651083b4d4edf3878dc0564562cdb00 /pytools
parentbd01c24d18852f4e03582d14ecde7c4d0f81fc4e (diff)
downloadblackbird-skeleton-8e5354ea40d562819c1f5749572dc3e1f975ef67.tar.gz
blackbird-skeleton-8e5354ea40d562819c1f5749572dc3e1f975ef67.zip
Cast dbus.Double for python-json
At some point a floating point value was added to a sensor object. python-json doesn't handle the dbus wrapper types like dbus.Double. Cast dbus.Double to a float, similar to integers. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'pytools')
-rw-r--r--pytools/obmcutil3
1 files changed, 3 insertions, 0 deletions
diff --git a/pytools/obmcutil b/pytools/obmcutil
index 6db589e..9207eca 100644
--- a/pytools/obmcutil
+++ b/pytools/obmcutil
@@ -16,6 +16,9 @@ def fix_byte(it,key,parent):
elif (isinstance(it,dbus.Byte)):
if (key != None):
parent[key] = int(it)
+ elif (isinstance(it,dbus.Double)):
+ if (key != None):
+ parent[key] = float(it)
else:
pass
OpenPOWER on IntegriCloud