mirror of
https://github.com/thingsboard/thingsboard-gateway
synced 2025-10-26 22:31:42 +08:00
Updated requirements list, updated configurable parameter "handleDeviceRenaming"
This commit is contained in:
4
setup.py
4
setup.py
@@ -59,7 +59,9 @@ setup(
|
|||||||
'requests',
|
'requests',
|
||||||
'PyInquirer',
|
'PyInquirer',
|
||||||
'pyfiglet',
|
'pyfiglet',
|
||||||
'termcolor'
|
'termcolor',
|
||||||
|
'grpcio',
|
||||||
|
'protobuf'
|
||||||
],
|
],
|
||||||
download_url='https://github.com/thingsboard/thingsboard-gateway/archive/%s.tar.gz' % VERSION,
|
download_url='https://github.com/thingsboard/thingsboard-gateway/archive/%s.tar.gz' % VERSION,
|
||||||
entry_points={
|
entry_points={
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ thingsboard:
|
|||||||
statsSendPeriodInSeconds: 3600
|
statsSendPeriodInSeconds: 3600
|
||||||
minPackSendDelayMS: 0
|
minPackSendDelayMS: 0
|
||||||
checkConnectorsConfigurationInSeconds: 60
|
checkConnectorsConfigurationInSeconds: 60
|
||||||
|
handleDeviceRenaming: true
|
||||||
security:
|
security:
|
||||||
accessToken: PUT_YOUR_GW_ACCESS_TOKEN_HERE
|
accessToken: PUT_YOUR_GW_ACCESS_TOKEN_HERE
|
||||||
qos: 1
|
qos: 1
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ class TBGatewayService:
|
|||||||
self.__load_persistent_devices()
|
self.__load_persistent_devices()
|
||||||
|
|
||||||
def __process_renamed_gateway_devices(self, renamed_device: dict):
|
def __process_renamed_gateway_devices(self, renamed_device: dict):
|
||||||
|
if self.__config.get('handleDeviceRenaming', True):
|
||||||
log.info("Received renamed gateway device notification: %s", renamed_device)
|
log.info("Received renamed gateway device notification: %s", renamed_device)
|
||||||
old_device_name, new_device_name = renamed_device.popitem()
|
old_device_name, new_device_name = renamed_device.popitem()
|
||||||
if old_device_name in list(self.__renamed_devices.values()):
|
if old_device_name in list(self.__renamed_devices.values()):
|
||||||
@@ -350,6 +351,8 @@ class TBGatewayService:
|
|||||||
self.__save_persistent_devices()
|
self.__save_persistent_devices()
|
||||||
self.__load_persistent_devices()
|
self.__load_persistent_devices()
|
||||||
log.debug("Current renamed_devices dict: %s", self.__renamed_devices)
|
log.debug("Current renamed_devices dict: %s", self.__renamed_devices)
|
||||||
|
else:
|
||||||
|
log.debug("Received renamed device notification %r, but device renaming handle is disabled", renamed_device)
|
||||||
|
|
||||||
def __process_remote_configuration(self, new_configuration):
|
def __process_remote_configuration(self, new_configuration):
|
||||||
if new_configuration is not None and self.__remote_configurator is not None:
|
if new_configuration is not None and self.__remote_configurator is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user