sdmclient

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceEndpoint

type DeviceEndpoint struct {
	*sdm.Service
	Name string
}

func (*DeviceEndpoint) GetDevice

func (d *DeviceEndpoint) GetDevice() (DeviceTraits, error)

func (*DeviceEndpoint) SetCool

func (d *DeviceEndpoint) SetCool(temp float64) error

func (*DeviceEndpoint) SetHeat

func (d *DeviceEndpoint) SetHeat(temp float64) error

func (*DeviceEndpoint) SetHeatCool

func (d *DeviceEndpoint) SetHeatCool(heat, cool float64) error

func (*DeviceEndpoint) SetMode

func (d *DeviceEndpoint) SetMode(mode string) error

type DeviceTraits

type DeviceTraits struct {
	CurrMode struct {
		Status    string
		Timestamp time.Time `json:"-"`
	} `json:"sdm.devices.traits.ThermostatHvac"`
	CurrTemp struct {
		TempCelsius float64   `json:"ambientTemperatureCelsius"`
		Timestamp   time.Time `json:"-"`
	} `json:"sdm.devices.traits.Temperature"`
	DisplayUnit struct {
		Unit      string    `json:"temperatureScale"`
		Timestamp time.Time `json:"-"`
	} `json:"sdm.devices.traits.Settings"`
	// TODO(nateinaction): Add support for humidity
	// Humidity struct {
	// 	Percent   float64   `json:"ambientHumidityPercent"`
	// 	Timestamp time.Time `json:"-"`
	// } `json:"sdm.devices.traits.Humidity"`
	TargetMode struct {
		Mode      string
		Timestamp time.Time `json:"-"`
	} `json:"sdm.devices.traits.ThermostatMode"`
	TargetTemp struct {
		HeatCelsius   float64
		CoolCelsius   float64
		HeatTimestamp time.Time `json:"-"`
		CoolTimestamp time.Time `json:"-"`
	} `json:"sdm.devices.traits.ThermostatTemperatureSetpoint"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL