Ver código fonte

Added measurement other for the two fields that I missed

Christopher Nethercott 3 anos atrás
pai
commit
a2a9c35d6a
1 arquivos alterados com 9 adições e 0 exclusões
  1. 9 0
      main.py

+ 9 - 0
main.py

@@ -30,6 +30,7 @@ def init_db():
         influxdb_client.switch_database(DB_DATABASE)
         print('{} - Switched to database {}'.format(datetime.datetime.now(), DB_DATABASE))
 
+
 def get_data_for_influxdb():
     influx_data = [
         {
@@ -59,6 +60,14 @@ def get_data_for_influxdb():
                 'unique_clients': int(pihole.unique_clients.replace(',','')),
                 'total_queries': int(pihole.total_queries.replace(',',''))
             }
+        },
+        {
+            'measurement': 'other',
+            'time': datetime.datetime.now(),
+            'fields': {
+                'status': True if pihole.status == 'enabled' else False,
+                'gravity_last_update': pihole.gravity_last_updated['absolute']
+            }
         }
     ]