Added `PropertiesChanged` signals for `byteorder` and `signed` property
updates. Updated D-Bus interface annotations to specify change signal
behavior for properties. Simplified `emit_io_change` implementation.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
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>
Introduced `GetByName` and `GetByPosition` methods in the D-Bus
interface and implementation for retrieving device object paths by name
or position. Updated `GetAllDevices` return type to `ao`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced a new `position` property with read access in the D-Bus
interface and implemented its corresponding method.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Renamed `ActivateIoEvents` to `ActivateIoSignals` and
`DeactivateIoEvents` to `DeactivateIoSignals` in both the D-Bus
interface and implementation to better align with D-Bus signal
semantics.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added a fallback mechanism to handle cases where integer values exceed
valid range by using raw byte arrays (`ay`). Updated D-Bus methods and
properties to support this behavior.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced the `bitaddress` property with read-write access to `Input`
and `Output` D-Bus interfaces. Implemented corresponding property
methods.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Replaced specific IO interface classes (`InterfaceInpBool`,
`InterfaceInpInt`, etc.) with generic `InterfaceInput` and
`InterfaceOutput` classes to simplify the hierarchy.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Updated `GetAllInputs` and `GetAllOutputs` methods in the D-Bus
interface to include explicit argument names (`object-path-list`) and
adjusted their types to `ao` not strings.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added a new `docs/dbus.md` file with an overview of standardized D-Bus
data types and their signatures. Updated `README.md` with a reference to
the documentation.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added `min_value` and `max_value` properties to integer IOs for
determining value ranges. Updated D-Bus interface with corresponding
properties.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added `inp` and `out` properties for accessing input and output paths in
`InterfaceDeviceManager`. Updated D-Bus interface with corresponding
properties.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
The `_get_io_path` method was removed from `InterfaceIoManager` and
replaced with the `get_io_path` utility function from `ios1_helper.py`
to reduce redundancy and improve code reusability.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added `address`, `byteorder`, and `length` properties to D-Bus
interfaces for IOs. Implemented corresponding property methods in
`ios1_helper.py`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced the `InterfaceDevice` class, enabling detailed device
property access through D-Bus. Updated `bus_provider_io` to include
device interfaces in the D-Bus provider.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Integrated the InterfaceDeviceManager class into the com.revolutionpi
.ios1 D-Bus bus provider. This addition enables managing device paths
and querying all devices via D-Bus.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced a new Python-based command-line tool `revpi-config` to manage
Revolution Pi features via D-Bus. The tool supports enabling,
disabling, checking status, and availability for various features.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Previously, the check only considered 'active' as a valid ActiveState.
This update ensures the system also accounts for units in the
'activating' state, improving compatibility with transitional states in
systemd services.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Renamed the key 'systemd-timesyncd' to 'ntp' in the services mapping.
This improves naming consistency and aligns it with the expected service
identifier. No functional changes were introduced.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added calls to `StatusChanged` in `Disable` and `Enable` methods to
notify when a feature's state is updated. This ensures proper tracking
and external communication of feature status changes.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
This change integrates the InterfaceSoftwareServices class into the list
of interfaces initialized by the bus provider. It ensures the new
interface is properly registered and available for use, improving
system functionality and extensibility.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduce `InterfaceSoftwareServices` to handle service enable/disable
actions, status, and availability via D-Bus. Consolidate `avahi` service
configuration into the new interface by removing redundant logic from
`revpi_config.py`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Moved the `simple_systemd` function to a dedicated `systemd_helper`
module to improve code organization and reusability. Updated imports
accordingly in affected files.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Updated `InterfaceRevpiConfig` to require a bus parameter, ensuring
proper initialization. Introduced a constructor in `DbusInterface` to
store the bus instance.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
This signal provides a mechanism for notifying changes in availability
status. It will complement the existing `StatusChanged` signal and
enhance the system's event-handling capabilities.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
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>
In order to be able to provide all functions of the DBus during testing,
the CI uses the Python 3.11 version in a Bookworm container for
testing. This is the version that is pre-installed in Debian Bookworm.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
A dbus session bus must be started for testing. The command
`dbus-run-session` creates a session for the following command. As a
result, `pytest` runs with its own session bus for the tests.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Systemd does not exist in the docker file. So we just set an machine-id,
which the dbus-daemon can use to start a session.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Refactored unit enable/disable actions to run in separate threads,
ensuring non-blocking operations. This enhances performance and avoids
potential delays during systemd operations.
Added systemd reload calls after unit enable/disable to reflect changes.
Adjusted DBus method calls to capture and utilize change outputs
effectively. This improves reliability in applying unit modifications.
The new docstrings provide detailed explanations of the purpose,
parameters, and return values for both functions, improving code
readability and maintainability. This ensures better understanding for
future contributors and reduces ambiguity.
This update introduces detailed docstrings for the `ComputeModuleTypes`
and `ConfigActions` enumeration classes. The docstrings provide
descriptions for each class and their attributes, improving code
readability and maintainability.
Enhance documentation for the `RevPiConfig` class, its methods, and
properties to improve code readability and ease of use. The added
docstrings provide clear explanations of the class's purpose,
attributes, and functionality for developers and users. This update
supports better maintainability and understanding of the codebase.
Enhance the `ConfigTxt` class with comprehensive docstrings for all
methods, providing clear explanations of their functionality,
parameters, and return values. This improves code readability and
facilitates easier maintenance and understanding for future developers.