mirror of
https://gitee.com/qpy-solutions/tracker-v2.git
synced 2025-05-18 18:48:25 +08:00
update: over speed alert
This commit is contained in:
parent
d4a97674a6
commit
97d24060e4
@ -57,6 +57,7 @@ class TrackerTimer(Singleton):
|
||||
self.quecthing_ota_timer()
|
||||
|
||||
def loc_timer(self):
|
||||
self.tracker.over_speed_check()
|
||||
self.tracker.machine_info_report()
|
||||
|
||||
def battery_timer(self):
|
||||
|
@ -118,6 +118,16 @@ class Tracker(Singleton):
|
||||
|
||||
return fault_code
|
||||
|
||||
def over_speed_check(self):
|
||||
if self.locator.gps:
|
||||
speed = self.locator.gps.read_location_GxVTG_speed()
|
||||
if speed:
|
||||
current_settings = settings.settings.get()
|
||||
if float(speed) > current_settings['app']['over_speed_threshold']:
|
||||
alert_code = 30003
|
||||
alert_info = {'local_time': utime.mktime(utime.localtime())}
|
||||
self.alert_report(alert_code, alert_info)
|
||||
|
||||
def energy_led_show(self, energy):
|
||||
current_settings = settings.settings.get()
|
||||
if energy <= current_settings['app']['low_power_shutdown_threshold']:
|
||||
|
@ -393,6 +393,24 @@ res = tracker.machine_check()
|
||||
|20005|三轴加速度传感器异常|
|
||||
|20006|麦克风异常|
|
||||
|
||||
#### over_speed_check 设备超速报警检测
|
||||
|
||||
该模块实现了检测当前设备运动速度检测,当当前速度(km/h)超出设定的超速阈值,则立即向云端进行报警,**该功能只在定位模式为GPS时生效**。
|
||||
|
||||
- 例:
|
||||
|
||||
```python
|
||||
tracker.over_speed_check()
|
||||
```
|
||||
|
||||
- 参数:
|
||||
|
||||
无
|
||||
|
||||
- 返回值:
|
||||
|
||||
无
|
||||
|
||||
### settings
|
||||
|
||||
该模块为配置参数模块
|
||||
|
Loading…
x
Reference in New Issue
Block a user