Skip to content

Commit

Permalink
Merge pull request #1621 from samson0v/issues/iotgw-393-392
Browse files Browse the repository at this point in the history
Fixed BACnet error handling and getting default values from config
  • Loading branch information
imbeacon authored Dec 12, 2024
2 parents e214f6b + d7c5f84 commit 04aa86a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion thingsboard_gateway/connectors/bacnet/bacnet_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,11 @@ async def __discover_devices(self):
for device_config in self.__config.get('devices', []):
try:
DeviceObjectConfig.update_address_in_config_util(device_config)
await self.__application.do_who_is(device_address=device_config['address'])
result = await self.__application.do_who_is(device_address=device_config['address'])
self.__log.debug('WhoIs request sent to device %s', device_config['address'])

if result is None:
self.__log.error('Device %s not found', device_config['address'])
except Exception as e:
self.__log.error('Error discovering device %s: %s', device_config['address'], e)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, config):
self.__network_number_quality = config.get('networkNumberQuality', 'configured')
self.__max_apdu_length_accepted = int(config.get('maxApduLengthAccepted', 1024))
self.__segmentation_supported = config.get('segmentationSupported', 'segmentedBoth')
self.__vendor_identifier = int(config.get('vendorIdentifier', 15))
self.__vendor_identifier = int(config.get('vendorIdentifier', 15) or 15)

@property
def device_object_config(self):
Expand Down

0 comments on commit 04aa86a

Please sign in to comment.