Browse Source

Erreur 1er commit

Passage de log INFO en ERROR
master
Christophe SCAYA 2 years ago
parent
commit
13b6388a92
  1. 4
      enphase.py

4
enphase.py

@ -7,7 +7,7 @@ import logging
import os import os
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
logging.basicConfig(level=logging.INFO, filename=os.path.join(os.path.dirname(__file__),'enphase.log'), filemode="a+",format="%(asctime)-15s %(levelname)-8s %(message)s") logging.basicConfig(level=logging.ERROR, filename=os.path.join(os.path.dirname(__file__),'enphase.log'), filemode="a+",format="%(asctime)-15s %(levelname)-8s %(message)s")
user='christophe.scaya@gmail.com' user='christophe.scaya@gmail.com'
password='92@!Z&KYxt8shT' password='92@!Z&KYxt8shT'
@ -34,7 +34,7 @@ while True:
total = round(json[0]['cumulative']['currW']) total = round(json[0]['cumulative']['currW'])
net = round(json[1]['cumulative']['currW']) net = round(json[1]['cumulative']['currW'])
panneaux = total-net panneaux = total-net
#esp_cmd = requests.get('http://'+ip_esp+'/control?cmd=event,setPwr='+str(net)) esp_cmd = requests.get('http://'+ip_esp+'/control?cmd=event,setPwr='+str(net))
logging.info("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net)) logging.info("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net))
print("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net)) print("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net))
time.sleep(2) time.sleep(2)

Loading…
Cancel
Save