edge/pkg/module/cast/chromecast/device.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

44 lines
848 B
Go

package chromecast
import (
"net"
"forge.cadoles.com/arcad/edge/pkg/module/cast"
)
const DeviceTypeChromecast cast.DeviceType = "chromecast"
type Device struct {
UUID string `goja:"uuid" json:"uuid"`
Host net.IP `goja:"host" json:"host"`
Port int `goja:"port" json:"port"`
Name string `goja:"name" json:"name"`
}
// DeviceHost implements cast.Device.
func (d *Device) DeviceHost() net.IP {
return d.Host
}
// DeviceID implements cast.Device.
func (d *Device) DeviceID() string {
return d.UUID
}
// DeviceName implements cast.Device.
func (d *Device) DeviceName() string {
return d.Name
}
// DevicePort implements cast.Device.
func (d *Device) DevicePort() int {
return d.Port
}
// DeviceType implements cast.Device.
func (d *Device) DeviceType() cast.DeviceType {
return DeviceTypeChromecast
}
var _ cast.Device = &Device{}