Эх сурвалжийг харах

优化查询流量月用量

zhangdongming 3 жил өмнө
parent
commit
1fd27f98d5

+ 3 - 3
Object/UnicomObject.py

@@ -266,9 +266,9 @@ class UnicomObjeect:
             device_usage_history_list = usage_history['data']['deviceUsageHistory']
             if device_usage_history_list:
                 for item in device_usage_history_list:
-                    if item['year'] == usage_year and item['month'] == usage_month:
-                        flow_total_usage += item['flowTotalUsage']
-                        break
+                    if item['year'] != usage_year and item['month'] != usage_month:
+                        continue
+                    flow_total_usage += item['flowTotalUsage']
         return flow_total_usage
 
     @staticmethod