feat(io): Add InterfaceDevice class for device handling via D-Bus
Introduced the `InterfaceDevice` class, enabling detailed device property access through D-Bus. Updated `bus_provider_io` to include device interfaces in the D-Bus provider. Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
@@ -8,11 +8,11 @@ from threading import Thread
|
||||
import revpimodio2
|
||||
from gi.repository import GLib
|
||||
from pydbus import SessionBus, SystemBus
|
||||
from revpimodio2 import Cycletools
|
||||
|
||||
from . import REVPI_DBUS_NAME
|
||||
from .interface_devices import (
|
||||
InterfaceDeviceManager,
|
||||
InterfaceDevice,
|
||||
)
|
||||
from .interface_ios import (
|
||||
InterfaceIoManager,
|
||||
@@ -75,6 +75,10 @@ class BusProviderIo(Thread):
|
||||
lst_interfaces = [
|
||||
(f"io/{io_name}", self._dc_io_interfaces[io_name]) for io_name in self._dc_io_interfaces
|
||||
]
|
||||
lst_interfaces += [
|
||||
(f"device/{device.position}", InterfaceDevice(self._bus, device))
|
||||
for device in self._modio.device
|
||||
]
|
||||
try:
|
||||
self._bus.publish(
|
||||
REVPI_DBUS_NAME,
|
||||
|
||||
Reference in New Issue
Block a user