K5:
authordxy15521469561 <1731678236@qq.com>
Sat, 19 Aug 2023 01:44:21 +0000 (09:44 +0800)
committerdxy15521469561 <1731678236@qq.com>
Sat, 19 Aug 2023 01:44:21 +0000 (09:44 +0800)
通话静音开关

2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui.py

index ce39c73..904a10f 100644 (file)
@@ -932,7 +932,7 @@ class DeviceInfoManager(Abstract):
 
                 if self.bat_time > 5*60:
                     self.bat_time = 0
-                    if battery[1] == 20:
+                    if battery[1] <= 20 and battery[1] > 0:
                         EventMesh.publish("load_screen", {"screen": "LOW_POWER"})
             else:
                 self.bat_time = 0
@@ -995,6 +995,7 @@ class DeviceInfoManager(Abstract):
                                 self.temp_state = 0
                                 self.temp_one_state = 0
                                 temp = EventMesh.publish(constants.EVENT.GET_TEMP) 
+                                temp += 0.5
                                 if temp < 25 or temp > 42:
                                     temp = 0
                                 tmp_f = str(temp).split('.')[0] 
@@ -1021,6 +1022,7 @@ class DeviceInfoManager(Abstract):
                                     elif self.temp_one_state > 6:
                                         self.temp_one_state = 0
                                         temp = EventMesh.publish(constants.EVENT.GET_TEMP) 
+                                        temp += 0.5
                                         if temp < 25 or temp > 42:
                                             temp = 0
                                         tmp_f = str(temp).split('.')[0] 
@@ -1061,6 +1063,7 @@ class DeviceInfoManager(Abstract):
                         elif self.temp_one_state > 6:
                             self.temp_one_state = 0
                             temp = EventMesh.publish(constants.EVENT.GET_TEMP) 
+                            temp += 0.5
                             if temp < 25 or temp > 42:
                                 temp = 0
                             tmp_f = str(temp).split('.')[0] 
@@ -1392,7 +1395,8 @@ class DeviceInfoManager(Abstract):
                     if get_temp_state == 2 or get_temp_state == 3:
                         self.temp_one_state = 0
                         self.temp_state = 0
-                        temp = EventMesh.publish(constants.EVENT.GET_TEMP)             
+                        temp = EventMesh.publish(constants.EVENT.GET_TEMP)       
+                        temp += 0.5      
                         if temp < 25 or temp > 42:
                             temp = 0
 
index 5857d2c..8f93981 100644 (file)
@@ -1515,9 +1515,7 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出
         if self.time_count >= 5:#5s内没有打通则不在继续拨打关闭
             self.time_count = 0
             EventMesh.publish("set_UI_high_priority", 0)
-            sos_flag = EventMesh.publish("get_sos_flag")
-            if sos_flag == 1:
-                EventMesh.publish("set_sos_info_call") 
+            EventMesh.publish("set_sos_info_call") 
 
             EventMesh.publish("load_screen", {"screen": "dial_no_connect_popup"})
 
@@ -1585,7 +1583,7 @@ class DialNoconnectPopupScreen(Screen):#你所拨打的电话暂时无法接通
     def timeout_hangup(self,e):
         EventMesh.publish("system_sleep_rest")#防止黑屏
         self.time_count+=1
-        if self.time_count >= 10:
+        if self.time_count >= 5:
             self.time_count = 0
             EventMesh.publish("return_prev_screen")
 
@@ -3275,11 +3273,12 @@ class OnCallScreen(Screen):
         on_call_label_name.set_text(name)
         # on_call_label.set_text(str(self.meta_info))
         on_call_second_label.set_text("00:00")
-        on_call_volum_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT)
+        on_call_volum_label.set_style_text_color(lv.color_make(128, 128, 128), lv.STATE.DEFAULT)
         self.phone_num = ''
         self.phone_list = []
         self.button = 0
         self.mute_btn = 0
+        voiceCall.mute(2,1,0)
 
     def show_num(self):
         global on_call_screen_tab_label
@@ -3422,10 +3421,13 @@ class OnCallScreen(Screen):
         global on_call_screen_tab,on_call_screen,on_call_obj
         if self.mute_btn == 0:#默认是开启
             self.mute_btn = 1
-            on_call_volum_label.set_style_text_color(lv.color_make(128, 128, 128), lv.STATE.DEFAULT)
-        else:
+            voiceCall.mute(2,0,0)
             on_call_volum_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT)
+        else:
+
+            on_call_volum_label.set_style_text_color(lv.color_make(128, 128, 128), lv.STATE.DEFAULT)
             self.mute_btn = 0
+            voiceCall.mute(2,1,0)
        # self.aud.setVolume(0)
         # if self.open_volum_state == 1:
         #     self.open_volum_state = 0