feat(io): Add Set* (Byteorder, Signed, Value) methods to IO interface
Introduced `SetByteorder` and `SetSigned` methods in both the `Input` and `Output` D-Bus interfaces, and added the `SetValue` method specifically for the `Output` interface. Implemented corresponding methods in the backend. Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
@@ -18,6 +18,12 @@ class InterfaceInput:
|
||||
"""
|
||||
<node>
|
||||
<interface name="com.revolutionpi.ios1.Input">
|
||||
<method name="SetByteorder">
|
||||
<arg name="order" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="SetSigned">
|
||||
<arg name="signed" type="b" direction="in"/>
|
||||
</method>
|
||||
<property name="address" type="n" access="read"/>
|
||||
<property name="bmk" type="s" access="read"/>
|
||||
<property name="bitaddress" type="n" access="readwrite"/>
|
||||
@@ -58,6 +64,12 @@ class InterfaceInput:
|
||||
[],
|
||||
)
|
||||
|
||||
def SetByteorder(self, order: str) -> None:
|
||||
self.byteorder = order
|
||||
|
||||
def SetSigned(self, signed: bool) -> None:
|
||||
self.signed = signed
|
||||
|
||||
@property
|
||||
def address(self) -> int:
|
||||
return self.io.address
|
||||
@@ -123,6 +135,15 @@ class InterfaceOutput(InterfaceInput):
|
||||
"""
|
||||
<node>
|
||||
<interface name="com.revolutionpi.ios1.Output">
|
||||
<method name="SetByteorder">
|
||||
<arg name="order" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="SetSigned">
|
||||
<arg name="signed" type="b" direction="in"/>
|
||||
</method>
|
||||
<method name="SetValue">
|
||||
<arg name="value" type="v" direction="in"/>
|
||||
</method>
|
||||
<property name="address" type="n" access="read"/>
|
||||
<property name="bmk" type="s" access="read"/>
|
||||
<property name="bitaddress" type="n" access="readwrite"/>
|
||||
@@ -138,6 +159,9 @@ class InterfaceOutput(InterfaceInput):
|
||||
|
||||
interface_name = "com.revolutionpi.ios1.Output"
|
||||
|
||||
def SetValue(self, value: Variant) -> None:
|
||||
self.value = value
|
||||
|
||||
@property
|
||||
def value(self) -> Variant:
|
||||
return super().value
|
||||
|
||||
Reference in New Issue
Block a user