From 8fd7e7cc659dadad87f8c8a8ee3c9b8e9f2ac598 Mon Sep 17 00:00:00 2001 From: okaegi Date: Mon, 8 Apr 2024 15:00:23 +0200 Subject: [PATCH 1/2] shelly mini gen3... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gen 2 und gen3 shlley mini unterscheiden sich im Namen. Siehe auch https://forum.openwb.de/viewtopic.php?p=106705#p106705 Kann für 1.9 und 2.0 übernommen werden --- packages/modules/smarthome/shelly/watt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/modules/smarthome/shelly/watt.py b/packages/modules/smarthome/shelly/watt.py index e4284f3dd..f67fdd69f 100644 --- a/packages/modules/smarthome/shelly/watt.py +++ b/packages/modules/smarthome/shelly/watt.py @@ -121,7 +121,7 @@ def totalPowerFromShellyJson(answer: Any, workchan: int) -> int: aktpower = int(answer['em:0']['c_act_power']) else: aktpower = int(answer['em:0']['total_act_power']) - elif ("SNPM-001PCEU16" in model): + elif ("PM-001PCEU16" in model): // SNPM-001PCEU16 (gen 2) und S3PM-001PCEU16 (gen 3) aktpower = int(answer['pm1:0']['apower']) else: aktpower = int(answer[sw]['apower']) From 37eafc6ad2630ea6ee998e952ff6bd6eaa563699 Mon Sep 17 00:00:00 2001 From: okaegi Date: Mon, 8 Apr 2024 15:05:06 +0200 Subject: [PATCH 2/2] Update watt.py flake8 --- packages/modules/smarthome/shelly/watt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/modules/smarthome/shelly/watt.py b/packages/modules/smarthome/shelly/watt.py index f67fdd69f..299ca52be 100644 --- a/packages/modules/smarthome/shelly/watt.py +++ b/packages/modules/smarthome/shelly/watt.py @@ -121,7 +121,8 @@ def totalPowerFromShellyJson(answer: Any, workchan: int) -> int: aktpower = int(answer['em:0']['c_act_power']) else: aktpower = int(answer['em:0']['total_act_power']) - elif ("PM-001PCEU16" in model): // SNPM-001PCEU16 (gen 2) und S3PM-001PCEU16 (gen 3) + elif ("PM-001PCEU16" in model): + # "SNPM-001PCEU16" (gen 2) und "S3PM-001PCEU16" (gen 3) aktpower = int(answer['pm1:0']['apower']) else: aktpower = int(answer[sw]['apower'])