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 logging import getLogger
|
||||
|
||||
from pydbus.generic import signal
|
||||
|
||||
from .revpi_config import (
|
||||
ConfigActions,
|
||||
configure_avahi_daemon,
|
||||
@@ -42,10 +44,16 @@ class InterfaceRevpiConfig(DbusInterface):
|
||||
<arg name="available" type="b" direction="out"/>
|
||||
</method>
|
||||
<property name="available_features" type="as" access="read"/>
|
||||
<signal name="StatusChanged">
|
||||
<arg name="feature" type="s"/>
|
||||
<arg name="status" type="b"/>
|
||||
</signal>
|
||||
</interface>
|
||||
</node>
|
||||
"""
|
||||
|
||||
StatusChanged = signal()
|
||||
|
||||
def Disable(self, feature: str) -> None:
|
||||
"""Disable the feature."""
|
||||
feature_function = get_feature(feature)
|
||||
|
||||
Reference in New Issue
Block a user