feat(io): Add inp and out properties to InterfaceDeviceManager
Added `inp` and `out` properties for accessing input and output paths in `InterfaceDeviceManager`. Updated D-Bus interface with corresponding properties. Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
@@ -8,7 +8,7 @@ from pydbus.generic import signal
|
||||
from revpimodio2 import RevPiModIO
|
||||
from revpimodio2.device import Device
|
||||
|
||||
from .ios1_helper import REVPI_DBUS_BASE_PATH
|
||||
from .ios1_helper import REVPI_DBUS_BASE_PATH, get_io_object_path
|
||||
|
||||
|
||||
class InterfaceDeviceManager:
|
||||
@@ -56,7 +56,9 @@ class InterfaceDevice:
|
||||
<property name="catalognr" type="s" access="read"/>
|
||||
<property name="comment" type="s" access="read"/>
|
||||
<property name="id" type="s" access="read"/>
|
||||
<property name="inp" type="ao" access="read"/>
|
||||
<property name="name" type="s" access="read"/>
|
||||
<property name="out" type="ao" access="read"/>
|
||||
<property name="type" type="s" access="read"/>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -85,10 +87,18 @@ class InterfaceDevice:
|
||||
def id(self):
|
||||
return self.device.id
|
||||
|
||||
@property
|
||||
def inp(self) -> list[str]:
|
||||
return [get_io_object_path(io) for io in self.device.get_inputs()]
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return self.device.name
|
||||
|
||||
@property
|
||||
def out(self) -> list[str]:
|
||||
return [get_io_object_path(io) for io in self.device.get_outputs()]
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
return self.device.type
|
||||
|
||||
Reference in New Issue
Block a user