Documentation ¶
Index ¶
- type Command
- func NewFanCommand(timerEnabled bool, duration time.Duration) Command
- func NewThermostatEcoCommand(enabled bool) Command
- func NewThermostatModeCommand(mode thermostatMode) Command
- func NewThermostatTemperatureSetpointCoolCommand(temp float32) Command
- func NewThermostatTemperatureSetpointHeatCommand(temp float32) Command
- func NewThermostatTemperatureSetpointRangeCommand(heatTemp, coolTemp float32) Command
- func StCommandToSdmCommands(stCommand *models.Command) ([]Command, error)
- type Device
- type DeviceConnectivityTraits
- type DeviceFanTraits
- type DeviceHumidityTraits
- type DeviceInfoTraits
- type DeviceSettingsTraits
- type DeviceTemperatureTraits
- type DeviceThermostatEco
- type DeviceThermostatHvac
- type DeviceThermostatMode
- type DeviceThermostatTemperatureSetpoint
- type Live
- func (c *Live) Devices() ([]Device, error)
- func (c *Live) GetDevice(deviceID string) (*Device, error)
- func (c *Live) MakeContext() (context.Context, context.CancelFunc)
- func (c *Live) Rooms(structureID string) ([]Room, error)
- func (c *Live) SendCommand(deviceID string, command Command) error
- func (c *Live) Structures() ([]Structure, error)
- func (c *Live) WithAccessToken(token string) SmartDeviceManagement
- func (c *Live) WithTimeout(d time.Duration) SmartDeviceManagement
- type Room
- type RoomInfoTraits
- type SmartDeviceManagement
- type StCapability
- type Structure
- type StructuresInfoTraits
- type TemperatureScale
- type Traits
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
// contains filtered or unexported methods
}
func NewThermostatEcoCommand ¶
func NewThermostatModeCommand ¶
func NewThermostatModeCommand(mode thermostatMode) Command
type DeviceConnectivityTraits ¶
type DeviceConnectivityTraits struct {
Online bool
}
func (DeviceConnectivityTraits) ToSmartthingsState ¶
func (t DeviceConnectivityTraits) ToSmartthingsState(traits Traits) []*models.DeviceStateStatesItems0
type DeviceFanTraits ¶
func (DeviceFanTraits) ToSmartthingsState ¶
func (t DeviceFanTraits) ToSmartthingsState(traits Traits) []*models.DeviceStateStatesItems0
type DeviceHumidityTraits ¶
type DeviceHumidityTraits struct {
AmbientHumidityPercent float32 `json:"ambientHumidityPercent"`
}
func (DeviceHumidityTraits) ToSmartthingsState ¶
func (t DeviceHumidityTraits) ToSmartthingsState(traits Traits) []*models.DeviceStateStatesItems0
func (*DeviceHumidityTraits) Unmarshal ¶
func (t *DeviceHumidityTraits) Unmarshal() interface{}
type DeviceInfoTraits ¶
type DeviceInfoTraits struct {
CustomName string `json:"customName"`
}
func (*DeviceInfoTraits) Unmarshal ¶
func (t *DeviceInfoTraits) Unmarshal() interface{}
type DeviceSettingsTraits ¶
type DeviceSettingsTraits struct {
TemperatureScale TemperatureScale
}
type DeviceTemperatureTraits ¶
type DeviceTemperatureTraits struct {
AmbientTemperatureCelsius float32 `json:"ambientTemperatureCelsius"`
}
func (DeviceTemperatureTraits) ToSmartthingsState ¶
func (t DeviceTemperatureTraits) ToSmartthingsState(traits Traits) []*models.DeviceStateStatesItems0
func (*DeviceTemperatureTraits) Unmarshal ¶
func (t *DeviceTemperatureTraits) Unmarshal() interface{}
type DeviceThermostatEco ¶
type DeviceThermostatHvac ¶
type DeviceThermostatHvac struct {
// contains filtered or unexported fields
}
func (DeviceThermostatHvac) ToSmartthingsState ¶
func (t DeviceThermostatHvac) ToSmartthingsState(traits Traits) []*models.DeviceStateStatesItems0
type DeviceThermostatMode ¶
type DeviceThermostatMode struct {
// contains filtered or unexported fields
}
func (DeviceThermostatMode) ToSmartthingsState ¶
func (t DeviceThermostatMode) ToSmartthingsState(traits Traits) []*models.DeviceStateStatesItems0
type DeviceThermostatTemperatureSetpoint ¶
type DeviceThermostatTemperatureSetpoint struct { HeatCelsius float32 `json:"heatCelsius"` CoolCelsius float32 `json:"coolCelsius"` }
func (DeviceThermostatTemperatureSetpoint) ToSmartthingsState ¶
func (t DeviceThermostatTemperatureSetpoint) ToSmartthingsState(traits Traits) []*models.DeviceStateStatesItems0
func (*DeviceThermostatTemperatureSetpoint) Unmarshal ¶
func (t *DeviceThermostatTemperatureSetpoint) Unmarshal() interface{}
type Live ¶
type Live struct {
// contains filtered or unexported fields
}
func NewLiveClient ¶
func (*Live) MakeContext ¶
func (c *Live) MakeContext() (context.Context, context.CancelFunc)
func (*Live) Structures ¶
func (*Live) WithAccessToken ¶
func (c *Live) WithAccessToken(token string) SmartDeviceManagement
func (*Live) WithTimeout ¶
func (c *Live) WithTimeout(d time.Duration) SmartDeviceManagement
type RoomInfoTraits ¶
type RoomInfoTraits struct {
CustomName string `json:"customName"`
}
func (*RoomInfoTraits) Unmarshal ¶
func (t *RoomInfoTraits) Unmarshal() interface{}
type SmartDeviceManagement ¶
type SmartDeviceManagement interface { WithAccessToken(token string) SmartDeviceManagement WithTimeout(d time.Duration) SmartDeviceManagement Structures() ([]Structure, error) Rooms(structureID string) ([]Room, error) Devices() ([]Device, error) GetDevice(deviceID string) (*Device, error) SendCommand(deviceID string, command Command) error }
type StCapability ¶
type StCapability interface {
ToSmartthingsState(traits Traits) []*models.DeviceStateStatesItems0
}
Convert data to a set of SmartThings device states ToSmartThingsState() may use data from other traits to compose the device state
type StructuresInfoTraits ¶
type StructuresInfoTraits struct {
CustomName string `json:"customName"`
}
func (*StructuresInfoTraits) Unmarshal ¶
func (t *StructuresInfoTraits) Unmarshal() interface{}
type TemperatureScale ¶
type TemperatureScale int
const ( TemperatureScaleCelsius TemperatureScale = iota TemperatureScaleFarenheit )
type Traits ¶
type Traits struct {
// contains filtered or unexported fields
}
A set of traits for a device
Click to show internal directories.
Click to hide internal directories.