1
0
mirror of https://github.com/thingsboard/thingsboard-gateway synced 2025-10-26 22:31:42 +08:00

Fix for statistic collecting in BLE Connector

This commit is contained in:
zbeacon
2020-02-20 11:30:27 +02:00
parent 0a130886ff
commit 0ae22cbf59

View File

@@ -250,9 +250,11 @@ class BLEConnector(Connector, Thread):
data = self.__service_processing(device, section['section_config'])
converter = section['converter']
converted_data = converter.convert(section, data)
self.statistics['MessagesReceived'] = self.statistics['MessagesReceived'] + 1
log.debug(data)
log.debug(converted_data)
self.__gateway.send_to_storage(self.get_name(), converted_data)
self.statistics['MessagesSent'] = self.statistics['MessagesSent'] + 1
except BTLEDisconnectError:
log.debug('Cannot connect to device %s', device)
continue
@@ -292,8 +294,8 @@ class BLEConnector(Connector, Thread):
continue
if converted_data is not None:
# self.__gateway.add_device(converted_data["deviceName"], {"connector": self})
self.statistics['MessagesSent'] = self.statistics['MessagesSent'] + 1
self.__gateway.send_to_storage(self.get_name(), converted_data)
self.statistics['MessagesSent'] = self.statistics['MessagesSent'] + 1
def __check_and_reconnect(self, device):
while self.__devices_around[device]['peripheral']._helper is None: