plusdeck.dbus.client

This module contains the core DbusClient abstraction, which is used to interact with a DBus service.

For information on how to use plusdeck domain objects with the DBus client, see the API docs for plusdeck.dbus.domain. For examples of how to use the DBus client, look at the source code for plusdeckctl.

DbusClient

Bases: DbusInterface

A DBus client for the Plus Deck 2C PC Cassette Deck.

Source code in plusdeck/dbus/client/__init__.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class DbusClient(DbusInterface):
    """
    A DBus client for the Plus Deck 2C PC Cassette Deck.
    """

    def __init__(self: Self) -> None:
        client = Mock(name="client", side_effect=NotImplementedError("client"))
        self.subscribe = Mock(name="client.subscribe")
        super().__init__(client)

        cast(Any, self)._proxify(DBUS_NAME, "/")

    async def staged_config(self: Self) -> StagedConfig:
        """
        Fetch the state of staged configuration changes.
        """

        active_config: Config = ConfigM.unpack(await self.config)

        return StagedConfig(
            target_config=Config.from_file(active_config.file),
            active_config=active_config,
        )

staged_config() async

Fetch the state of staged configuration changes.

Source code in plusdeck/dbus/client/__init__.py
22
23
24
25
26
27
28
29
30
31
32
async def staged_config(self: Self) -> StagedConfig:
    """
    Fetch the state of staged configuration changes.
    """

    active_config: Config = ConfigM.unpack(await self.config)

    return StagedConfig(
        target_config=Config.from_file(active_config.file),
        active_config=active_config,
    )