From 8e208cdc9864427a3917fd240997cfc311aa0679 Mon Sep 17 00:00:00 2001 From: MarblemanQ Date: Thu, 13 Jul 2023 21:13:05 +0200 Subject: [PATCH] Formerly included gobject is not available on Venus 3.xx but GLib is... --- test/dummybattery.py | 6 +++--- test/dummypvinverter.py | 7 ++++--- test/dummysolarcharger.py | 6 +++--- test/dummyvebus.py | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/test/dummybattery.py b/test/dummybattery.py index 5f6aa3e..1d7a344 100755 --- a/test/dummybattery.py +++ b/test/dummybattery.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from dbus.mainloop.glib import DBusGMainLoop -import gobject +from gi.repository import GLib import argparse import sys import os @@ -37,6 +37,6 @@ '/Dc/0/Current': {'initial': -15, 'update': 0}, '/Soc': {'initial': 10, 'update': 0}}) -print('Connected to dbus, and switching over to gobject.MainLoop() (= event based)') -mainloop = gobject.MainLoop() +print('Connected to dbus, and switching over to GLib.MainLoop() (= event based)') +mainloop = GLib.MainLoop() mainloop.run() diff --git a/test/dummypvinverter.py b/test/dummypvinverter.py index f03e675..c906e95 100755 --- a/test/dummypvinverter.py +++ b/test/dummypvinverter.py @@ -2,7 +2,7 @@ # takes data from the dbus, does calculations with it, and puts it back on from dbus.mainloop.glib import DBusGMainLoop -import gobject +from gi.repository import GLib import argparse import sys import os @@ -36,6 +36,7 @@ pvac_output = DbusDummyService( servicename=args.name, + productname='PVInverter', deviceinstance=args.position, paths={ '/Ac/L1/Power': {'initial': 0, 'update': 0}, @@ -44,8 +45,8 @@ '/Ac/Energy/Forward': {'initial': 0, 'update': 1}, '/Position': {'initial': int(args.position), 'update': 0}}) -logger.info('Connected to dbus, and switching over to gobject.MainLoop() (= event based)') -mainloop = gobject.MainLoop() +logger.info('Connected to dbus, and switching over to GLib.MainLoop() (= event based)') +mainloop = GLib.MainLoop() mainloop.run() diff --git a/test/dummysolarcharger.py b/test/dummysolarcharger.py index d0c7811..d675919 100755 --- a/test/dummysolarcharger.py +++ b/test/dummysolarcharger.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from dbus.mainloop.glib import DBusGMainLoop -import gobject +from gi.repository import GLib import argparse import sys import os @@ -38,7 +38,7 @@ productname='Solarcharger', connection='VE.Direct port 1') -logger.info('Connected to dbus, and switching over to gobject.MainLoop() (= event based)') -mainloop = gobject.MainLoop() +logger.info('Connected to dbus, and switching over to GLib.MainLoop() (= event based)') +mainloop = GLib.MainLoop() mainloop.run() diff --git a/test/dummyvebus.py b/test/dummyvebus.py index ce9c4a5..da5ca26 100755 --- a/test/dummyvebus.py +++ b/test/dummyvebus.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from dbus.mainloop.glib import DBusGMainLoop -import gobject +from gi.repository import GLib import argparse import sys import os @@ -44,6 +44,6 @@ '/Ac/Out/L1/P': {'initial': 0, 'update': 0}} ) -logger.info('Connected to dbus, and switching over to gobject.MainLoop() (= event based)') -mainloop = gobject.MainLoop() +logger.info('Connected to dbus, and switching over to GLib.MainLoop() (= event based)') +mainloop = GLib.MainLoop() mainloop.run()