update: gps sleep method

This commit is contained in:
JackSun 2022-05-26 14:28:09 +08:00
parent 188991a931
commit cbe51169d0
4 changed files with 24 additions and 23 deletions

@ -1 +1 @@
Subproject commit 853e2ccafe0a6a715bfd86f4134759ecdbf00c16
Subproject commit a35456c05c1115b5f8e63c1208b77f649d97d8a3

View File

@ -189,7 +189,7 @@ class Collector(Singleton):
def __locator_gps_hibernation_strategy(self, onoff):
"""Set GPS sleep"""
current_settings = settings.get()
work_cycle_period = current_settings["UserConfig"]["work_cycle_period"]
work_cycle_period = current_settings["user_cfg"]["work_cycle_period"]
if self.__locator.gps:
if work_cycle_period >= 3600:
self.__locator.gps.power_switch(onoff)
@ -412,6 +412,7 @@ class Collector(Singleton):
device_data = {
"power_switch": power_switch,
"local_time": self.__get_local_time(),
"gps_mode": current_settings["LocConfig"]["gps_mode"],
}
# Get ota status & drive behiver code

View File

@ -617,7 +617,7 @@
"dataType": {
"type": "int",
"specs": {
"min": "0",
"min": "3600",
"max": "2147483647",
"unit": "s",
"unitName": "秒",
@ -1203,7 +1203,7 @@
"dataType": {
"type": "int",
"specs": {
"min": "0",
"min": "3600",
"max": "2147483647",
"unit": "s",
"unitName": "秒",
@ -1556,7 +1556,7 @@
"dataType": {
"type": "int",
"specs": {
"min": "0",
"min": "3600",
"max": "2147483647",
"unit": "s",
"unitName": "秒",
@ -2173,7 +2173,7 @@
"dataType": {
"type": "int",
"specs": {
"min": "0",
"min": "3600",
"max": "2147483647",
"unit": "s",
"unitName": "秒",

View File

@ -2,7 +2,7 @@
"profile":{
"tslVersion":"1.1.0",
"productKey":"p11275",
"version":"20220428155940369"
"version":"20220526133940091"
},
"properties":[
{
@ -808,22 +808,6 @@
"type":"PROPERTY",
"desc":""
},
{
"specs":{
"unit":"s",
"min":"0",
"max":"2147483647",
"step":"1"
},
"code":"work_mode_timeline",
"dataType":"INT",
"name":"休眠策略参考时间",
"subType":"RW",
"id":44,
"sort":35,
"type":"PROPERTY",
"desc":""
},
{
"specs":{
"unit":"s",
@ -839,6 +823,22 @@
"sort":36,
"type":"PROPERTY",
"desc":"-1一直等待直到读取到数据才进行返回\n0不等待读取接口返回数据后立即返回\n>0: 等待超时时间,单位秒"
},
{
"specs":{
"unit":"s",
"min":"3600",
"max":"2147483647",
"step":"1"
},
"code":"work_mode_timeline",
"dataType":"INT",
"name":"休眠策略参考时间",
"subType":"RW",
"id":1,
"sort":37,
"type":"PROPERTY",
"desc":""
}
],
"events":[