Skip to content

Power Control Role #127

Description

@DanielHabenicht

If a sendspin client is used as a proxy for a sound system (or the goal is to save power by shutting down amplifiers) there currently is no way to control the power state via the protocol.
The current controller role only supports volume, mute and state or severing the connection (with not way to turn it back on).

Examples for external power control:

  • the bluetooth connection to a speaker
  • the sound system via e.g. RF or IR.
  • a power switch to an external system

Other protocols also support this use case, e.g. Squeezelite -S <Power Script>.

This would also allow to implement real power control in music assistant for sendspin devices, see https://github.com/orgs/music-assistant/discussions/4359

Proposal: power@v1 role

Every client which lists the power role in the supported_roles of the client/hello message needs to implement all messages in this section.

Server → Client: server/command controller object

The controller object in server/command has this structure:

  • power: object
    • desired_state: 'on' | 'off'

'on' - turn the sound system on, so audio playback of music is possible
'off' - turn the sound system off, so audio playback of music is not possible

Client→ Server: client/state power object

The power object in client/state has this structure:

  • controller: object
    • supported_states: string[] - subset of: 'on' | 'off'
    • current_state: string - one of supported_states

When a client cannot play music because the sound system is off it should either send state: 'error' via client/state, or turn on the sound system to resume playback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions