edge/pkg/module/cast/chromecast/status.go
William Petit 335b34625b
All checks were successful
arcad/edge/pipeline/head This commit looks good
feat(module): generalizing casting process
2024-01-12 12:11:41 +01:00

32 lines
836 B
Go

package chromecast
import "forge.cadoles.com/arcad/edge/pkg/module/cast"
type DeviceStatus struct {
CurrentApp DeviceStatusCurrentApp `goja:"currentApp" json:"currentApp"`
Volume DeviceStatusVolume `goja:"volume" json:"volume"`
}
// State implements cast.DeviceStatus.
func (s *DeviceStatus) State() string {
return s.CurrentApp.StatusText
}
// Title implements cast.DeviceStatus.
func (s *DeviceStatus) Title() string {
return s.CurrentApp.DisplayName
}
var _ cast.DeviceStatus = &DeviceStatus{}
type DeviceStatusCurrentApp struct {
ID string `goja:"id" json:"id"`
DisplayName string `goja:"displayName" json:"displayName"`
StatusText string `goja:"statusText" json:"statusText"`
}
type DeviceStatusVolume struct {
Level float64 `goja:"level" json:"level"`
Muted bool `goja:"muted" json:"muted"`
}