googlecast

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVICE_TYPE_GOOGLECAST = "_googlecast._tcp"
	DELTA_LOOKUP_TIME       = 60 * time.Second
)
View Source
const (
	CAST_DEFAULT_SENDER   = "sender-0"
	CAST_DEFAULT_RECEIVER = "receiver-0"
	CAST_NS_CONN          = "urn:x-cast:com.google.cast.tp.connection"
	CAST_NS_HEARTBEAT     = "urn:x-cast:com.google.cast.tp.heartbeat"
	CAST_NS_RECV          = "urn:x-cast:com.google.cast.receiver"
	CAST_NS_MEDIA         = "urn:x-cast:com.google.cast.media"
)
View Source
const (
	READ_TIMEOUT    = 500 * time.Millisecond
	STATUS_INTERVAL = 5 * time.Second
)

Variables

This section is empty.

Functions

func NewAddedEvent

func NewAddedEvent(source gopi.Unit, device mutablehome.CastDevice) gopi.Event

func NewRemovedEvent

func NewRemovedEvent(source gopi.Unit, device mutablehome.CastDevice) gopi.Event

func NewUpdatedEvent

func NewUpdatedEvent(source gopi.Unit, device mutablehome.CastDevice) gopi.Event

Types

type Cast

type Cast struct {
	Discovery gopi.RPCServiceDiscovery
	Bus       gopi.Bus
	Timeout   time.Duration
}

func (Cast) Name

func (Cast) Name() string

func (Cast) New

func (config Cast) New(log gopi.Logger) (gopi.Unit, error)

type Device

type Device struct {
	Service gopi.RPCServiceRecord
}

func (Device) Name

func (Device) Name() string

func (Device) New

func (config Device) New(log gopi.Logger) (gopi.Unit, error)

type LaunchAppRequest

type LaunchAppRequest struct {
	PayloadHeader
	AppId string `json:"appId"`
}

func (*LaunchAppRequest) WithId

func (this *LaunchAppRequest) WithId(id int) Payload

type LoadMediaRequest

type LoadMediaRequest struct {
	PayloadHeader
	Media       mediaItem `json:"media"`
	CurrentTime int       `json:"currentTime,omitempty"`
	Autoplay    bool      `json:"autoplay,omitempty"`
}

func (*LoadMediaRequest) WithId

func (this *LoadMediaRequest) WithId(id int) Payload

type LoadQueueItem

type LoadQueueItem struct {
	Media            mediaItem `json:"media"`
	Autoplay         bool      `json:"autoplay"`
	PlaybackDuration uint      `json:"playbackDuration"`
}

type LoadQueueRequest

type LoadQueueRequest struct {
	PayloadHeader
	RepeatMode string          `json:"repeatMode"`
	Items      []LoadQueueItem `json:"items"`
}

type MediaStatusResponse

type MediaStatusResponse struct {
	PayloadHeader
	Status []media `json:"status"`
}

type Payload

type Payload interface {
	WithId(id int) Payload
}

type PayloadHeader

type PayloadHeader struct {
	Type      string `json:"type"`
	RequestId int    `json:"requestId,omitempty"`
}

func (*PayloadHeader) WithId

func (this *PayloadHeader) WithId(id int) Payload

type ReceiverStatusResponse

type ReceiverStatusResponse struct {
	PayloadHeader
	Status struct {
		Applications []application `json:"applications"`
		Volume       volume        `json:"volume"`
	} `json:"status"`
}

type SetVolumeRequest

type SetVolumeRequest struct {
	PayloadHeader
	Volume volume `json:"volume"`
}

func (*SetVolumeRequest) WithId

func (this *SetVolumeRequest) WithId(id int) Payload

Jump to

Keyboard shortcuts

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