Skip to content

Commit

Permalink
Merge pull request #276 from snuids/master
Browse files Browse the repository at this point in the history
Check that the returned value is not None
  • Loading branch information
ChristianTremblay committed Jul 28, 2021
2 parents fef37bf + 9e5ab88 commit 12414cf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions BAC0/core/devices/mixins/read_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ def _find_propid_index(key):

pointName = point_infos[_find_propid_index("objectName")]
presentValue = point_infos[_find_propid_index("presentValue")]
if obj_type == "analog":
presentValue = float(presentValue)
elif obj_type == "multi":
presentValue = int(presentValue)
if presentValue!=None:
if obj_type == "analog":
presentValue = float(presentValue)
elif obj_type == "multi":
presentValue = int(presentValue)
try:
point_description = point_infos[_find_propid_index("description")]
except KeyError:
Expand Down

0 comments on commit 12414cf

Please sign in to comment.