Skip to content

Commit

Permalink
Merge pull request #304 from gnmerritt/connect-no-name
Browse files Browse the repository at this point in the history
Continue device connection with empty/null objectName prop
  • Loading branch information
ChristianTremblay committed Dec 17, 2021
2 parents ff3a980 + 09fdfc7 commit e5e3005
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions BAC0/core/devices/Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,11 +883,10 @@ def connect(self, *, db=None):
else:
segmentation_supported = True

if name:
if segmentation_supported:
self.new_state(RPMDeviceConnected)
else:
self.new_state(RPDeviceConnected)
if segmentation_supported:
self.new_state(RPMDeviceConnected)
else:
self.new_state(RPDeviceConnected)

except SegmentationNotSupported:
self.segmentation_supported = False
Expand Down
4 changes: 2 additions & 2 deletions BAC0/core/devices/mixins/read_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Licensed under LGPLv3, see file LICENSE in this source tree.
#
"""
read_mixin.py - Add ReadProperty and ReadPropertyMultiple to a device
read_mixin.py - Add ReadProperty and ReadPropertyMultiple to a device
"""
# --- standard Python modules ---

Expand Down Expand Up @@ -381,7 +381,7 @@ def _process_new_objects(
presentValue = self.read_single(
"{} {} presentValue ".format(point_type, point_address)
)
if obj_type == "analog":
if obj_type == "analog" and presentValue:
presentValue = float(presentValue)

_newpoints.append(
Expand Down

0 comments on commit e5e3005

Please sign in to comment.