feat(dbus): Add StatusChanged DBus signal to interface configuration
Introduced the `StatusChanged` signal in `.RevpiConfig` interface to notify changes in feature status. Emitting this signal in `Enable` and `Disable` methods ensures real-time updates for feature state changes. This enhances communication and monitoring within the DBus middleware. Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from pydbus.generic import signal
|
||||||
|
|
||||||
from .revpi_config import (
|
from .revpi_config import (
|
||||||
ConfigActions,
|
ConfigActions,
|
||||||
configure_avahi_daemon,
|
configure_avahi_daemon,
|
||||||
@@ -42,10 +44,16 @@ class InterfaceRevpiConfig(DbusInterface):
|
|||||||
<arg name="available" type="b" direction="out"/>
|
<arg name="available" type="b" direction="out"/>
|
||||||
</method>
|
</method>
|
||||||
<property name="available_features" type="as" access="read"/>
|
<property name="available_features" type="as" access="read"/>
|
||||||
|
<signal name="StatusChanged">
|
||||||
|
<arg name="feature" type="s"/>
|
||||||
|
<arg name="status" type="b"/>
|
||||||
|
</signal>
|
||||||
</interface>
|
</interface>
|
||||||
</node>
|
</node>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
StatusChanged = signal()
|
||||||
|
|
||||||
def Disable(self, feature: str) -> None:
|
def Disable(self, feature: str) -> None:
|
||||||
"""Disable the feature."""
|
"""Disable the feature."""
|
||||||
feature_function = get_feature(feature)
|
feature_function = get_feature(feature)
|
||||||
|
|||||||
Reference in New Issue
Block a user