Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that the returned value is not None #276

Merged
merged 4 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -256,10 +256,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
2 changes: 1 addition & 1 deletion BAC0/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
__email__ = "christian.tremblay@servisys.com"
__url__ = "https://github.com/ChristianTremblay/BAC0"
__download_url__ = "https://github.com/ChristianTremblay/BAC0/archive/master.zip"
__version__ = "21.02.11dev"
__version__ = "21.07.27dev"
__license__ = "LGPLv3"