feat(io): Add position property to InterfaceDevice

Introduced a new `position` property with read access in the D-Bus
interface and implemented its corresponding method.

Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
Sven Sager
2026-02-04 14:30:29 +01:00
parent 6f1bd7f7ea
commit 8ee5e0836f

View File

@@ -59,6 +59,7 @@ class InterfaceDevice:
<property name="inp" type="ao" access="read"/> <property name="inp" type="ao" access="read"/>
<property name="name" type="s" access="read"/> <property name="name" type="s" access="read"/>
<property name="out" type="ao" access="read"/> <property name="out" type="ao" access="read"/>
<property name="position" type="n" access="read"/>
<property name="type" type="s" access="read"/> <property name="type" type="s" access="read"/>
</interface> </interface>
</node> </node>
@@ -99,6 +100,10 @@ class InterfaceDevice:
def out(self) -> list[str]: def out(self) -> list[str]:
return [get_io_object_path(io) for io in self.device.get_outputs()] return [get_io_object_path(io) for io in self.device.get_outputs()]
@property
def position(self) -> int:
return self.device.position
@property @property
def type(self): def type(self):
return self.device.type return self.device.type