fix(io): Add property methods on integer IOs
Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user