lib

package
v0.0.0-...-46a610b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSnapclient

func CreateSnapclient(config SnapClientConfig) (*snapclient.Client, error)

Types

type SnapClientConfig

type SnapClientConfig struct {
	SnapServerAddress string
}

type SnapcastClient

type SnapcastClient struct {
	ClientID  string  `json:"client_id"`
	Host      string  `json:"host"`
	GroupID   string  `json:"group_id"`
	GroupName string  `json:"group_name"`
	StreamID  string  `json:"stream_id"`
	Connected bool    `json:"connected"` // true, false
	Volume    float64 `json:"volume"`
	Muted     bool    `json:"muted"` // true, false
}

snapcast/client/id Client.GetStatus

type SnapcastGroup

type SnapcastGroup struct {
	GroupID   string                    `json:"group_id"`
	GroupName string                    `json:"group_name"`
	Muted     bool                      `json:"muted"`
	StreamID  string                    `json:"stream_id"`
	Clients   map[string]SnapcastClient `json:"clients"`
}

snapcast/group/id Group.GetStatus

type SnapcastMQTTBridge

type SnapcastMQTTBridge struct {
	common.BaseMQTTBridge
	SnapClient       *snapclient.Client
	SnapClientConfig SnapClientConfig
	ServerStatus     SnapcastServer
	// contains filtered or unexported fields
}

func NewSnapcastMQTTBridge

func NewSnapcastMQTTBridge(snapClientConfig SnapClientConfig, mqttClient mqtt.Client, topicPrefix string) (*SnapcastMQTTBridge, error)

func (*SnapcastMQTTBridge) EventLoop

func (bridge *SnapcastMQTTBridge) EventLoop(ctx context.Context)

type SnapcastServer

type SnapcastServer struct {
	Groups  map[string]SnapcastGroup  `json:"groups"`
	Streams map[string]SnapcastStream `json:"streams"`
	Clients map[string]SnapcastClient `json:"clients"`
}

type SnapcastStream

type SnapcastStream struct {
	StreamID string `json:"stream_id"`
	Status   string `json:"status"` // playing, idle
}

snapcast/stream/id

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL