From a6197903bc4f9c98b9ca3317d546382a0b88ecb5 Mon Sep 17 00:00:00 2001 From: Morg42 <43153739+Morg42@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:14:49 +0100 Subject: [PATCH] smartmeter: fix standalone operations --- smartmeter/dlms.py | 7 ++++++- smartmeter/sml.py | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/smartmeter/dlms.py b/smartmeter/dlms.py index d8abe3b8e..7a547a06a 100755 --- a/smartmeter/dlms.py +++ b/smartmeter/dlms.py @@ -49,7 +49,12 @@ from threading import Lock from typing import (Union, Tuple, Any) -from lib.model.smartplugin import SmartPlugin +# only for syntax/type checking +try: + from lib.model.smartplugin import SmartPlugin +except ImportError: + pass + """ This module implements the query of a smartmeter using the DLMS protocol. diff --git a/smartmeter/sml.py b/smartmeter/sml.py index 760842c6e..c2c35a143 100755 --- a/smartmeter/sml.py +++ b/smartmeter/sml.py @@ -51,7 +51,11 @@ from threading import Lock from typing import Union -from lib.model.smartplugin import SmartPlugin +# only for syntax/type checking +try: + from lib.model.smartplugin import SmartPlugin +except ImportError: + pass """ This module implements the query of a smartmeter using the SML protocol.