Skip to content

Commit

Permalink
Added sending current logs configuration to the ThingsBoard instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
imbeacon committed Jan 24, 2020
1 parent 74b0190 commit 92cdf75
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thingsboard_gateway/gateway/tb_gateway_remote_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def send_current_configuration(self):
for config_file in self.__gateway._connectors_configs[connector]:
current_configuration[connector].append(config_file)
current_configuration["thingsboard"] = self.__old_general_configuration_file
current_configuration["thingsboard"]["logs"] = b64encode(self.__old_logs_configuration.encode("UTF-8"))
encoded_current_configuration = b64encode(dumps(current_configuration).encode())
self.__old_configuration = encoded_current_configuration
self.__gateway.tb_client.client.send_attributes(
Expand All @@ -95,11 +96,14 @@ def __process_connectors_configuration(self):
self.__old_connectors_configs = {}
self.__new_connectors_configs = {}
self.__old_general_configuration_file = self.__new_general_configuration_file
self.__old_logs_configuration = self.__new_logs_configuration
self.__new_logs_configuration = None
self.__new_general_configuration_file = {}
else:
log.error("A remote general configuration applying has been failed.")
self.__old_connectors_configs = {}
self.__new_connectors_configs = {}
self.__new_logs_configuration = None
self.__new_general_configuration_file = {}
return

Expand Down

0 comments on commit 92cdf75

Please sign in to comment.