diff --git a/tests/inverter_check.py b/tests/inverter_check.py index 4f4548f..9c56862 100644 --- a/tests/inverter_check.py +++ b/tests/inverter_check.py @@ -2,9 +2,12 @@ import asyncio import logging import sys +from importlib.metadata import version # Force the local files, not pip installed lib +sys.path.insert(0, '../goodwe') sys.path.insert(0, '../../goodwe') + import goodwe logging.basicConfig( @@ -16,6 +19,19 @@ if sys.platform.startswith('win'): asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) +module_ver = None +try: + module_ver = version('goodwe') +except ModuleNotFoundError: + pass + +if module_ver: + print("WARNING !!!") + print("==============================") + print(f"You are executing code with installed pip version goodwe:{module_ver}") + print("You are not testing the local files, if that was what you meant !!!") + print("==============================") + # Set the appropriate IP address IP_ADDRESS = "192.168.2.14" PORT = 8899