update: work mode choice method

This commit is contained in:
JackSun-qc 2022-03-24 16:23:22 +08:00
parent 3905712304
commit fad941169d
3 changed files with 11 additions and 13 deletions

View File

@ -85,24 +85,21 @@ class PowerManage(Singleton):
self.low_energy_queue.put('power_dwon')
def get_low_energy_method(self):
current_settings = settings.get()
device_model = modem.getDevModel()
support_methds = LOWENERGYMAP.get(device_model)
if not support_methds:
raise SettingsError('This Model %s Not Set LOWENERGYMAP.' % device_model)
if self.period >= 3600:
if "POWERDOWN" in support_methds:
self.low_energy_method = "POWERDOWN"
elif "PSM" in support_methds:
self.low_energy_method = "PSM"
elif "PM" in support_methds:
self.low_energy_method = "PM"
elif 60 <= self.period < 3600:
if self.period >= current_settings['sys']['work_mode_timeline']:
if "PSM" in support_methds:
self.low_energy_method = "PSM"
elif "POWERDOWN" in support_methds:
self.low_energy_method = "POWERDOWN"
elif "PM" in support_methds:
self.low_energy_method = "PM"
elif self.period < 60:
self.low_energy_method = "PM"
else:
if "PM" in support_methds:
self.low_energy_method = "PM"

View File

@ -211,6 +211,8 @@ class default_values_sys(object):
cloud_timeout = 180
work_mode_timeline = 3600
ali_burning_method = _ali_burning_method.one_machine_one_density
_quecIot = {

View File

@ -55,9 +55,8 @@
2. 语音监听时
3. 录音时
- 根据不同的应用场景,上报工作模式分别有以下三种:
1. 周期性模式 -- 周期性上报设备信息
2. 智能模式 -- 开启GPS定位时运动上报静止不上报可设置周期
3. 低功耗模式(开发中) -- 周期性开机后上报设备信息,上报完成后关机
1. 周期性模式 -- 周期性上报设备信息,上报完成后进入低功耗模式
2. 智能模式 -- 开启GPS定位时运动上报上报完成后进入低功耗模式静止不上报直接进入低功耗模式
- 上报工作模式与上报周期由云端或手机APP控制默认周期性上报上报周期30秒。
#### OTA升级(开发中)
@ -96,7 +95,7 @@
- 功能的开启超速阈值可由云端或手机APP控制。默认关闭该功能。
- 报警代码30003
#### 拔卡报警(开发中)
#### 拔卡报警
- SIM卡拔出时报警此时网络不通按照网络不通的逻辑处理。
- 功能的开启可由云端或手机APP控制。默认开启该功能。