From 304b388253a5ec224265a7157fe7cb221bb6f975 Mon Sep 17 00:00:00 2001 From: Xavier Beaudouin Date: Sun, 11 Jul 2021 22:37:58 +0200 Subject: [PATCH] First --- plugin.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/plugin.py b/plugin.py index df42897..21512bc 100644 --- a/plugin.py +++ b/plugin.py @@ -32,11 +32,7 @@ sys.path.append('/usr/local/lib/python3.7/dist-packages') sys.path.append('/usr/local/lib/python3.8/dist-packages') sys.path.append('/usr/local/lib/python3.9/dist-packages') -import pymodbus - -from pyModbusTCP.client import ModbusClient -from pymodbus.constants import Endian -from pymodbus.payload import BinaryPayloadDecoder +import sdm_modbus # # Domoticz shows graphs with intervals of 5 minutes. @@ -116,16 +112,12 @@ class BasePlugin: return def onStart(self): - try: - Domoticz.Log("DS238-2 ZN/S Energy Meter TCP loaded!, using python v" + sys.version[:6] + " and pymodbus v" + pymodbus.__version__) - except: - Domoticz.Log("DS238-2 ZN/S Energy Meter TCP loaded!") + Domoticz.Log("SDM120c Energy Meter TCP loaded!") # Check dependancies try: if (float(Parameters["DomoticzVersion"][:6]) < float("2020.2")): Domoticz.Error("WARNING: Domoticz version is outdated or not supported. Please update!") if (float(sys.version[:1]) < 3): Domoticz.Error("WARNING: Python3 should be used !") - if (float(pymodbus.__version__[:3]) < float("2.3")): Domoticz.Error("WARNING: pymodbus version is outdated, please update!") except: Domoticz.Error("Warning ! Dependancies could not be checked !")