mirror of
https://gitee.com/qpy-solutions/tracker-v2.git
synced 2025-05-19 02:58:25 +08:00
update: 1. save quecthing device secret when device key is not empty; 2. modules; 3. device check location check.
This commit is contained in:
parent
4765a7e960
commit
82eb6aba16
@ -1 +1 @@
|
||||
Subproject commit 0bbd038a7d94f68b0bae71f72d1b9e40d9c6d98f
|
||||
Subproject commit 1dd9c6ff7ef4badddf0e5c61a343256ef6b05b56
|
@ -26,7 +26,7 @@ class SYSConfig(object):
|
||||
|
||||
log_level = "DEBUG"
|
||||
|
||||
cloud = _cloud.AliYun
|
||||
cloud = _cloud.quecIot
|
||||
|
||||
checknet_timeout = 60
|
||||
|
||||
|
@ -209,6 +209,14 @@ def tracker():
|
||||
# Business start
|
||||
# Cloud start
|
||||
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
|
||||
collector.report_history()
|
||||
# OTA status init
|
||||
|
@ -55,17 +55,8 @@ class DeviceCheck(object):
|
||||
if not self.__locator:
|
||||
raise TypeError("self.__locator is not registered")
|
||||
|
||||
current_settings = settings.get()
|
||||
gps_data = None
|
||||
|
||||
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)
|
||||
loc_info = self.__locator.read(retry=30)
|
||||
for k, v in loc_info.items():
|
||||
gps_data = v
|
||||
if gps_data:
|
||||
|
Loading…
x
Reference in New Issue
Block a user