fix(io): Add property methods on integer IOs

Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
Sven Sager
2026-01-30 13:26:21 +01:00
parent b8b99ed3b0
commit 4dd4c814b5

View File

@@ -56,7 +56,8 @@ class InterfaceIoManager:
interface = self._dc_io_interfaces[io_name] interface = self._dc_io_interfaces[io_name]
if ct.changed(interface.io): if ct.changed(interface.io):
interface.emit_io_change() interface.emit_io_change()
self.IoChanged(interface.io.name, Variant(interface.variant_type, interface.io.value)) self.IoChanged(interface.io.name,
Variant(interface.variant_type, interface.io.value))
def _get_io_path(self, io_name: str) -> str: def _get_io_path(self, io_name: str) -> str:
return f"{REVPI_DBUS_BASE_PATH}/io/{io_name}" return f"{REVPI_DBUS_BASE_PATH}/io/{io_name}"
@@ -144,6 +145,18 @@ class InterfaceInpInt(DbusInterfaceIo):
interface_name = "com.revolutionpi.ios1.InpInt" interface_name = "com.revolutionpi.ios1.InpInt"
@property
def bmk(self) -> str:
return self.io.bmk
@property
def name(self) -> str:
return self.io.name
@property
def value(self) -> bool:
return self.io.value
class InterfaceOutInt(InterfaceInpInt): class InterfaceOutInt(InterfaceInpInt):
""" """
@@ -157,3 +170,12 @@ class InterfaceOutInt(InterfaceInpInt):
""" """
interface_name = "com.revolutionpi.ios1.OutInt" interface_name = "com.revolutionpi.ios1.OutInt"
@property
def value(self) -> bool:
return super().value
@value.setter
def value(self, value: bool):
self.io.value = value
self.io._parentdevice._modio.writeprocimg()