From 3cf181ce671f23f0122a876ced3ef5a48c527fd7 Mon Sep 17 00:00:00 2001 From: scayac Date: Thu, 16 May 2024 18:53:32 +0200 Subject: [PATCH] =?UTF-8?q?gestion=20plus=20"g=C3=A9n=C3=A9rale"=20des=20e?= =?UTF-8?q?xceptions=20Ajout=20du=20script=20updateESP.sh=20pour=20mettre?= =?UTF-8?q?=20=C3=A0=20jour=20le=20module=20ESPEasy=20distant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes to be committed: modified: enphase.py new file: updateESP.sh --- enphase.py | 2 +- updateESP.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 updateESP.sh diff --git a/enphase.py b/enphase.py index 4d2ea20..ce257e1 100644 --- a/enphase.py +++ b/enphase.py @@ -38,6 +38,6 @@ while True: logging.info("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net)) print("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net)) time.sleep(2) - except requests.exceptions.RequestException as e: + except Exception as e: logging.error(e) time.sleep(30) diff --git a/updateESP.sh b/updateESP.sh new file mode 100644 index 0000000..7fc09bb --- /dev/null +++ b/updateESP.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Execute une commande distance sur le module ESP +# syntaxe : updateESP.sh PARAM VALUE +# PARAM : 3 -> min_temp ; 4 -> min_prct + +IP="192.168.0.115" + +[ ! -z "$1" ] || echo "PARAM is empty" +[ ! -z "$2" ] || echo "VALUE is empty" + +if [ ! -z "$1" ] && [ ! -z "$2" ]; then + curl http://$IP/control?cmd=taskvalueset,3,$1,$2 +else + echo "Leaving script :-(" +fi