diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-06-24 09:09:29 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-06-24 13:17:29 -0400 |
commit | 8e5354ea40d562819c1f5749572dc3e1f975ef67 (patch) | |
tree | bfd15dfe4651083b4d4edf3878dc0564562cdb00 /pytools | |
parent | bd01c24d18852f4e03582d14ecde7c4d0f81fc4e (diff) | |
download | blackbird-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/obmcutil | 3 |
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 |