update: 1. save quecthing device secret when device key is not empty; 2. modules; 3. device check location check.

This commit is contained in:
JackSun 2022-09-09 10:53:55 +08:00
parent 4765a7e960
commit 82eb6aba16
4 changed files with 11 additions and 12 deletions

@ -1 +1 @@
Subproject commit 0bbd038a7d94f68b0bae71f72d1b9e40d9c6d98f Subproject commit 1dd9c6ff7ef4badddf0e5c61a343256ef6b05b56

View File

@ -26,7 +26,7 @@ class SYSConfig(object):
log_level = "DEBUG" log_level = "DEBUG"
cloud = _cloud.AliYun cloud = _cloud.quecIot
checknet_timeout = 60 checknet_timeout = 60

View File

@ -209,6 +209,14 @@ def tracker():
# Business start # Business start
# Cloud start # Cloud start
cloud.init() cloud.init()
# Quecthing save device secret when device key is not IMEI.
if current_settings["sys"]["cloud"] & SYSConfig._cloud.quecIot:
if cloud_init_params["DK"] and not cloud_init_params["DS"]:
_ds = cloud.get_device_secret()
if _ds != cloud_init_params["DS"]:
cloud_init_params["DS"] = _ds
settings.set("cloud", cloud_init_params)
settings.save()
# Report history # Report history
collector.report_history() collector.report_history()
# OTA status init # OTA status init

View File

@ -55,17 +55,8 @@ class DeviceCheck(object):
if not self.__locator: if not self.__locator:
raise TypeError("self.__locator is not registered") raise TypeError("self.__locator is not registered")
current_settings = settings.get()
gps_data = None gps_data = None
loc_info = self.__locator.read(retry=30)
if current_settings["user_cfg"].get("loc_method"):
loc_method = current_settings["user_cfg"].get("loc_method")
elif current_settings["sys"]["base_cfg"]["LocConfig"]:
loc_method = current_settings["LocConfig"].get("loc_method")
else:
loc_method = 7
loc_info = self.__locator.read(loc_method)
for k, v in loc_info.items(): for k, v in loc_info.items():
gps_data = v gps_data = v
if gps_data: if gps_data: