Browse Source

update: 增加配置文件

Moeyuuko 2 years ago
parent
commit
9d97f0993f
3 changed files with 6 additions and 3 deletions
  1. 2 1
      .gitignore
  2. 1 0
      Config.py.new
  3. 3 2
      influxdb_w.py

+ 2 - 1
.gitignore

@@ -1 +1,2 @@
-__pycache__/
+__pycache__/
+Config.py

+ 1 - 0
Config.py.new

@@ -0,0 +1 @@
+api = "http://XXXXX:8086/write?db=XXXXX&precision=s"

+ 3 - 2
influxdb_w.py

@@ -35,8 +35,9 @@ GPIO.setup (Weather_3in1,GPIO.IN)
 GPIO.setup (Powpin_INA219,GPIO.IN)
 GPIO.setup (Sunpin_INA219,GPIO.IN)
 
-api = "http://www.moeyuuko.com:8086/write?db=sumpower&precision=s"
-auth = ('sumpower', 'gA3!aX') #放心 没开放外网 密码随便填的
+import Config
+api = Config.api
+auth = Config.auth
 ticks = time.time() #记录运行时间戳  不需要了 避免树莓派时钟抽风 让服务器记录时间
 #print(ticks)
 print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))