44 lines
848 B
Go
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{}
|