Documentation
¶
Index ¶
- Constants
- type BatteryChannel
- type BatteryDevice
- type BrightnessChannel
- type BrightnessDevice
- type ColorChannel
- type ColorDevice
- type ColorState
- type EnergyChannel
- type EnergyDevice
- type GenericMediaItem
- type GenericMediaState
- type HumidityChannel
- type HumidityDevice
- type IdentifyChannel
- type IdentifyDevice
- type IlluminanceChannel
- type MediaChannel
- func (c *MediaChannel) GetProtocol() string
- func (c *MediaChannel) PlayUrl(url *string) error
- func (c *MediaChannel) QueueUrl(url *string) error
- func (c *MediaChannel) SendGenericState(state *GenericMediaItem) error
- func (c *MediaChannel) SendMusicTrackState(state *MusicTrackMediaItem, position *int) error
- func (c *MediaChannel) SetEventHandler(handler func(event string, payload ...interface{}) error)
- type MediaContentType
- type MediaControlChannel
- func (c *MediaControlChannel) GetProtocol() string
- func (c *MediaControlChannel) Next() error
- func (c *MediaControlChannel) Pause() error
- func (c *MediaControlChannel) Play() error
- func (c *MediaControlChannel) Previous() error
- func (c *MediaControlChannel) SendState(event MediaControlEvent) error
- func (c *MediaControlChannel) SetEventHandler(handler func(event string, payload ...interface{}) error)
- func (c *MediaControlChannel) Stop() error
- func (c *MediaControlChannel) TogglePlay() error
- type MediaControlDevice
- type MediaControlEvent
- type MediaDevice
- type MediaItem
- type MediaItemAlbum
- type MediaItemArtist
- type MediaItemImage
- type MoistureChannel
- type MoistureDevice
- type MotionChannel
- type MusicTrackMediaItem
- type MusicTrackMediaState
- type Notification
- type OnOffChannel
- func (c *OnOffChannel) GetProtocol() string
- func (c *OnOffChannel) SendState(on bool) error
- func (c *OnOffChannel) Set(state *bool) error
- func (c *OnOffChannel) SetEventHandler(handler func(event string, payload ...interface{}) error)
- func (c *OnOffChannel) Toggle() error
- func (c *OnOffChannel) TurnOff() error
- func (c *OnOffChannel) TurnOn() error
- type OnOffDevice
- type PowerChannel
- type PowerDevice
- type PresenceChannel
- type TemperatureChannel
- type TemperatureDevice
- type TransitionChannel
- type TransitionDevice
- type VolumeChannel
- func (c *VolumeChannel) GetProtocol() string
- func (c *VolumeChannel) Mute() error
- func (c *VolumeChannel) SendState(state *VolumeState) error
- func (c *VolumeChannel) Set(state *VolumeState) error
- func (c *VolumeChannel) SetEventHandler(handler func(event string, payload ...interface{}) error)
- func (c *VolumeChannel) ToggleMuted() error
- func (c *VolumeChannel) Unmute() error
- func (c *VolumeChannel) VolumeDown() error
- func (c *VolumeChannel) VolumeUp() error
- type VolumeDevice
- type VolumeState
Constants ¶
View Source
const ( NotificationPriorityMax = "max" NotificationPriorityHigh = "high" NotificationPriorityDefault = "default" NotificationPriorityLow = "low" NotificationPriorityMin = "min" )
View Source
const ( NotificationCategoryAlert = "alert" NotificationCategoryQuery = "query" NotificationCategorySuggestion = "suggestion" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatteryChannel ¶
type BatteryChannel struct {
// contains filtered or unexported fields
}
func NewBatteryChannel ¶
func NewBatteryChannel(device BatteryDevice) *BatteryChannel
func (*BatteryChannel) GetProtocol ¶
func (c *BatteryChannel) GetProtocol() string
func (*BatteryChannel) SendState ¶
func (c *BatteryChannel) SendState(state float64) error
func (*BatteryChannel) SendWarning ¶
func (c *BatteryChannel) SendWarning() error
func (*BatteryChannel) SetEventHandler ¶
type BatteryDevice ¶
type BatteryDevice interface { }
type BrightnessChannel ¶
type BrightnessChannel struct {
// contains filtered or unexported fields
}
func NewBrightnessChannel ¶
func NewBrightnessChannel(device BrightnessDevice) *BrightnessChannel
func (*BrightnessChannel) GetProtocol ¶
func (c *BrightnessChannel) GetProtocol() string
func (*BrightnessChannel) SendState ¶
func (c *BrightnessChannel) SendState(state float64) error
func (*BrightnessChannel) Set ¶
func (c *BrightnessChannel) Set(state float64) error
func (*BrightnessChannel) SetEventHandler ¶
type BrightnessDevice ¶
type ColorChannel ¶
type ColorChannel struct {
// contains filtered or unexported fields
}
func NewColorChannel ¶
func NewColorChannel(device ColorDevice) *ColorChannel
func (*ColorChannel) GetProtocol ¶
func (c *ColorChannel) GetProtocol() string
func (*ColorChannel) SendState ¶
func (c *ColorChannel) SendState(state *ColorState) error
func (*ColorChannel) Set ¶
func (c *ColorChannel) Set(state *ColorState) error
func (*ColorChannel) SetEventHandler ¶
type ColorDevice ¶
type ColorDevice interface {
SetColor(state *ColorState) error
}
type ColorState ¶
type EnergyChannel ¶
type EnergyChannel struct {
// contains filtered or unexported fields
}
func NewEnergyChannel ¶
func NewEnergyChannel(device EnergyDevice) *EnergyChannel
func (*EnergyChannel) GetProtocol ¶
func (c *EnergyChannel) GetProtocol() string
func (*EnergyChannel) SendState ¶
func (c *EnergyChannel) SendState(state float64) error
func (*EnergyChannel) SetEventHandler ¶
type EnergyDevice ¶
type EnergyDevice interface { }
type GenericMediaItem ¶
type GenericMediaState ¶
type GenericMediaState struct {
Media *GenericMediaItem `json:"media,omitempty"`
}
type HumidityChannel ¶
type HumidityChannel struct {
// contains filtered or unexported fields
}
func NewHumidityChannel ¶
func NewHumidityChannel(device HumidityDevice) *HumidityChannel
func (*HumidityChannel) GetProtocol ¶
func (c *HumidityChannel) GetProtocol() string
func (*HumidityChannel) SendState ¶
func (c *HumidityChannel) SendState(state float64) error
func (*HumidityChannel) SetEventHandler ¶
type HumidityDevice ¶
type HumidityDevice interface { }
type IdentifyChannel ¶
type IdentifyChannel struct {
// contains filtered or unexported fields
}
func NewIdentifyChannel ¶
func NewIdentifyChannel(device IdentifyDevice) *IdentifyChannel
func (*IdentifyChannel) GetProtocol ¶
func (c *IdentifyChannel) GetProtocol() string
func (*IdentifyChannel) Identify ¶
func (c *IdentifyChannel) Identify() error
func (*IdentifyChannel) SetEventHandler ¶
type IdentifyDevice ¶
type IdentifyDevice interface {
Identify() error
}
type IlluminanceChannel ¶
type IlluminanceChannel struct {
// contains filtered or unexported fields
}
func NewIlluminanceChannel ¶
func NewIlluminanceChannel() *IlluminanceChannel
func (*IlluminanceChannel) GetProtocol ¶
func (c *IlluminanceChannel) GetProtocol() string
func (*IlluminanceChannel) SendState ¶
func (c *IlluminanceChannel) SendState(state float64) error
func (*IlluminanceChannel) SetEventHandler ¶
type MediaChannel ¶
type MediaChannel struct {
// contains filtered or unexported fields
}
A MediaChannel can be added to devices, exposing http://schema.ninjablocks.com/protocol/media
func NewMediaChannel ¶
func NewMediaChannel(device MediaDevice) *MediaChannel
func (*MediaChannel) GetProtocol ¶
func (c *MediaChannel) GetProtocol() string
func (*MediaChannel) PlayUrl ¶
func (c *MediaChannel) PlayUrl(url *string) error
func (*MediaChannel) QueueUrl ¶
func (c *MediaChannel) QueueUrl(url *string) error
func (*MediaChannel) SendGenericState ¶
func (c *MediaChannel) SendGenericState(state *GenericMediaItem) error
func (*MediaChannel) SendMusicTrackState ¶
func (c *MediaChannel) SendMusicTrackState(state *MusicTrackMediaItem, position *int) error
func (*MediaChannel) SetEventHandler ¶
type MediaContentType ¶
type MediaContentType string
func (*MediaContentType) IsValid ¶
func (m *MediaContentType) IsValid() bool
type MediaControlChannel ¶
type MediaControlChannel struct {
// contains filtered or unexported fields
}
A MediaControlChannel can be added to devices, exposing http://schema.ninjablocks.com/protocol/media-control
func NewMediaControlChannel ¶
func NewMediaControlChannel(device MediaControlDevice) *MediaControlChannel
func (*MediaControlChannel) GetProtocol ¶
func (c *MediaControlChannel) GetProtocol() string
func (*MediaControlChannel) Next ¶
func (c *MediaControlChannel) Next() error
func (*MediaControlChannel) Pause ¶
func (c *MediaControlChannel) Pause() error
func (*MediaControlChannel) Play ¶
func (c *MediaControlChannel) Play() error
func (*MediaControlChannel) Previous ¶
func (c *MediaControlChannel) Previous() error
func (*MediaControlChannel) SendState ¶
func (c *MediaControlChannel) SendState(event MediaControlEvent) error
func (*MediaControlChannel) SetEventHandler ¶
func (*MediaControlChannel) Stop ¶
func (c *MediaControlChannel) Stop() error
func (*MediaControlChannel) TogglePlay ¶
func (c *MediaControlChannel) TogglePlay() error
type MediaControlDevice ¶
type MediaControlEvent ¶
type MediaControlEvent int
const ( MediaControlEventPlaying MediaControlEvent = iota MediaControlEventPaused MediaControlEventStopped MediaControlEventBuffering MediaControlEventBusy MediaControlEventIdle MediaControlEventInactive )
func (*MediaControlEvent) Name ¶
func (e *MediaControlEvent) Name() string
type MediaDevice ¶
type MediaItem ¶
type MediaItem struct { ID *string `json:"id,omitempty"` ExternalIDs *map[string]string `json:"externalIds,omitempty"` ContentType *MediaContentType `json:"contentType,omitempty"` Type *string `json:"type,omitempty"` Title *string `json:"title,omitempty"` Image *MediaItemImage `json:"image,omitempty"` Duration *int `json:"duration,omitempty"` }
type MediaItemAlbum ¶
type MediaItemAlbum struct { ID *string `json:"id,omitempty"` Name string `json:"name"` Image *MediaItemImage `json:"image,omitempty"` Genres *[]string `json:"genres,omitempty"` // contains filtered or unexported fields }
type MediaItemArtist ¶
type MediaItemArtist struct { ID *string `json:"id,omitempty"` Name string `json:"name"` Image *MediaItemImage `json:"image,omitempty"` // contains filtered or unexported fields }
type MediaItemImage ¶
type MoistureChannel ¶
type MoistureChannel struct {
// contains filtered or unexported fields
}
func NewMoistureChannel ¶
func NewMoistureChannel(device MoistureDevice) *MoistureChannel
func (*MoistureChannel) GetProtocol ¶
func (c *MoistureChannel) GetProtocol() string
func (*MoistureChannel) SendState ¶
func (c *MoistureChannel) SendState(state float64) error
func (*MoistureChannel) SetEventHandler ¶
type MoistureDevice ¶
type MoistureDevice interface { }
type MotionChannel ¶
type MotionChannel struct {
// contains filtered or unexported fields
}
func NewMotionChannel ¶
func NewMotionChannel() *MotionChannel
func (*MotionChannel) GetProtocol ¶
func (c *MotionChannel) GetProtocol() string
func (*MotionChannel) SendMotion ¶
func (c *MotionChannel) SendMotion() error
func (*MotionChannel) SetEventHandler ¶
type MusicTrackMediaItem ¶
type MusicTrackMediaItem struct { ID *string `json:"id,omitempty"` ExternalIDs *map[string]string `json:"externalIds,omitempty"` ContentType *MediaContentType `json:"contentType,omitempty"` Type string `json:"type"` Title *string `json:"title,omitempty"` Image *MediaItemImage `json:"image,omitempty"` Duration *int `json:"duration,omitempty"` Artists *[]MediaItemArtist `json:"artists,omitempty"` Album *MediaItemAlbum `json:"album,omitempty"` }
type MusicTrackMediaState ¶
type MusicTrackMediaState struct { Media *MusicTrackMediaItem `json:"media,omitempty"` Position *int `json:"position,omitempty"` }
type Notification ¶
type OnOffChannel ¶
type OnOffChannel struct {
// contains filtered or unexported fields
}
An OnOffChannel can be added to devices, exposing http://schema.ninjablocks.com/protocol/on-off
func NewOnOffChannel ¶
func NewOnOffChannel(device OnOffDevice) *OnOffChannel
func (*OnOffChannel) GetProtocol ¶
func (c *OnOffChannel) GetProtocol() string
func (*OnOffChannel) SendState ¶
func (c *OnOffChannel) SendState(on bool) error
func (*OnOffChannel) Set ¶
func (c *OnOffChannel) Set(state *bool) error
func (*OnOffChannel) SetEventHandler ¶
func (*OnOffChannel) Toggle ¶
func (c *OnOffChannel) Toggle() error
func (*OnOffChannel) TurnOff ¶
func (c *OnOffChannel) TurnOff() error
func (*OnOffChannel) TurnOn ¶
func (c *OnOffChannel) TurnOn() error
type OnOffDevice ¶
type PowerChannel ¶
type PowerChannel struct {
// contains filtered or unexported fields
}
func NewPowerChannel ¶
func NewPowerChannel(device PowerDevice) *PowerChannel
func (*PowerChannel) GetProtocol ¶
func (c *PowerChannel) GetProtocol() string
func (*PowerChannel) SendState ¶
func (c *PowerChannel) SendState(state float64) error
func (*PowerChannel) SetEventHandler ¶
type PowerDevice ¶
type PowerDevice interface { }
type PresenceChannel ¶
type PresenceChannel struct {
// contains filtered or unexported fields
}
func NewPresenceChannel ¶
func NewPresenceChannel() *PresenceChannel
func (*PresenceChannel) GetProtocol ¶
func (c *PresenceChannel) GetProtocol() string
func (*PresenceChannel) SendState ¶
func (c *PresenceChannel) SendState(state bool) error
func (*PresenceChannel) SetEventHandler ¶
type TemperatureChannel ¶
type TemperatureChannel struct {
// contains filtered or unexported fields
}
func NewTemperatureChannel ¶
func NewTemperatureChannel(device TemperatureDevice) *TemperatureChannel
func (*TemperatureChannel) GetProtocol ¶
func (c *TemperatureChannel) GetProtocol() string
func (*TemperatureChannel) SendState ¶
func (c *TemperatureChannel) SendState(state float64) error
func (*TemperatureChannel) SetEventHandler ¶
type TemperatureDevice ¶
type TemperatureDevice interface { }
type TransitionChannel ¶
type TransitionChannel struct {
// contains filtered or unexported fields
}
func NewTransitionChannel ¶
func NewTransitionChannel(device TransitionDevice) *TransitionChannel
func (*TransitionChannel) GetProtocol ¶
func (c *TransitionChannel) GetProtocol() string
func (*TransitionChannel) Set ¶
func (c *TransitionChannel) Set(state *int) error
func (*TransitionChannel) SetEventHandler ¶
type TransitionDevice ¶
type VolumeChannel ¶
type VolumeChannel struct {
// contains filtered or unexported fields
}
func NewVolumeChannel ¶
func NewVolumeChannel(device VolumeDevice) *VolumeChannel
func (*VolumeChannel) GetProtocol ¶
func (c *VolumeChannel) GetProtocol() string
func (*VolumeChannel) Mute ¶
func (c *VolumeChannel) Mute() error
func (*VolumeChannel) SendState ¶
func (c *VolumeChannel) SendState(state *VolumeState) error
func (*VolumeChannel) Set ¶
func (c *VolumeChannel) Set(state *VolumeState) error
func (*VolumeChannel) SetEventHandler ¶
func (*VolumeChannel) ToggleMuted ¶
func (c *VolumeChannel) ToggleMuted() error
func (*VolumeChannel) Unmute ¶
func (c *VolumeChannel) Unmute() error
func (*VolumeChannel) VolumeDown ¶
func (c *VolumeChannel) VolumeDown() error
func (*VolumeChannel) VolumeUp ¶
func (c *VolumeChannel) VolumeUp() error
type VolumeDevice ¶
type VolumeState ¶
Click to show internal directories.
Click to hide internal directories.