فهرست منبع

Casted information to floats in the two authenticated dictionaries

Christopher Nethercott 3 سال پیش
والد
کامیت
0eac4ee9c7
1فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 9 2
      main.py

+ 9 - 2
main.py

@@ -76,10 +76,17 @@ def get_data_for_influxdb():
 
     return influx_data
 
+def get_formatted_authenticated_query_types():
+    formatted_dict = {}
+    for key in pihole.query_types:
+        formatted_dict[key] = float(pihole.query_types[key])
+    
+    return formatted_dict
+
 def get_formatted_authenticated_forward_destinations():
     formatted_dict = {}
     for key in pihole.forward_destinations['forward_destinations']:
-        formatted_dict[key.split('|')[0]] = pihole.forward_destinations['forward_destinations'][key]
+        formatted_dict[key.split('|')[0]] = float(pihole.forward_destinations['forward_destinations'][key])
     
     return formatted_dict
 
@@ -88,7 +95,7 @@ def get_authenticated_data_for_influxdb():
         {
             'measurement': 'authenticated_query_types',
             'time': datetime.datetime.now(),
-            'fields': pihole.query_types
+            'fields': get_formatted_authenticated_query_types()
         },
         {
             'measurement': 'authenticated_forward_destinations',