Browse Source

OpenWeatherMap温湿度返回整型

locky 1 năm trước cách đây
mục cha
commit
e1bb952645
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      Object/IPWeatherObject.py

+ 2 - 2
Object/IPWeatherObject.py

@@ -217,6 +217,6 @@ class OpenWeatherMap:
         res_data = eval(res.text)
         if res_data['cod'] != 200:
             return None, None
-        temp = res_data['main']['temp']
-        humidity = res_data['main']['humidity']
+        temp = int(res_data['main']['temp'])
+        humidity = int(res_data['main']['humidity'])
         return temp, humidity