Documentation
¶
Overview ¶
Copyright © 2024 Donald Gifford dgifford06@gmail.com
Copyright © 2024 Donald Gifford dgifford06@gmail.com
Copyright © 2024 Donald Gifford dgifford06@gmail.com
Copyright © 2024 Donald Gifford dgifford06@gmail.com
Copyright © 2024 Donald Gifford dgifford06@gmail.com
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func Authenticate(conf AuthConfig) *oauth2.Token
Types ¶
type AuthConfig ¶
type AuthConfig struct {
// contains filtered or unexported fields
}
func InitConfig ¶
func InitConfig(ctx context.Context) AuthConfig
func (*AuthConfig) GetToken ¶
func (a *AuthConfig) GetToken() *oauth2.Token
func (*AuthConfig) ReadTokenFromFile ¶
func (a *AuthConfig) ReadTokenFromFile(tokenFileName string) *oauth2.Token
func (*AuthConfig) SaveTokenToFile ¶
func (a *AuthConfig) SaveTokenToFile(oAuthToken *oauth2.Token)
type Config ¶
type Config struct { Auth ConfigAuth Nest ConfigNest InfluxDB ConfigInfluxDB }
type ConfigAuth ¶
type ConfigInfluxDB ¶
type ConfigNest ¶
type DeviceTraits ¶
type DeviceTraits struct {
// contains filtered or unexported fields
}
type InfluxDBClient ¶
type InfluxDBClient struct {
// contains filtered or unexported fields
}
func CreateInfluxDBClient ¶
func CreateInfluxDBClient() InfluxDBClient
func (*InfluxDBClient) WritePoint ¶
func (i *InfluxDBClient) WritePoint(t Traits)
type InfluxDBClientConfig ¶
type InfluxDBClientConfig struct {
// contains filtered or unexported fields
}
type NestDevice ¶
type NestDevice struct {
// contains filtered or unexported fields
}
type NestMetric ¶
type NestMetric struct {
// contains filtered or unexported fields
}
type Sdm ¶
type Sdm struct {
// contains filtered or unexported fields
}
func NewSdmService ¶
func NewSdmService(config AuthConfig, t *oauth2.Token) Sdm
func (*Sdm) GetDevice ¶
func (s *Sdm) GetDevice() NestDevice
func (*Sdm) GetDeviceTraits ¶
func (s *Sdm) GetDeviceTraits(nd NestDevice) (Traits, error)
type Traits ¶
type Traits struct { Connectivity struct { Status string `json:"status"` } `json:"sdm.devices.traits.Connectivity"` Fan struct { TimerMode string `json:"timerMode"` } `json:"sdm.devices.traits.Fan"` Humidity struct { AmbientHumidityPercent int `json:"ambientHumidityPercent"` } `json:"sdm.devices.traits.Humidity"` Info struct { CustomName string `json:"customName"` } `json:"sdm.devices.traits.Info"` Settings struct { TemperatureScale string `json:"temperatureScale"` } `json:"sdm.devices.traits.Settings"` Temperature struct { AmbientTemperatureCelsius float64 `json:"ambientTemperatureCelsius"` } `json:"sdm.devices.traits.Temperature"` ThermostatEco struct { AvailableModes []string `json:"availableModes"` CoolCelsius float64 `json:"coolCelsius"` HeatCelsius float64 `json:"heatCelsius"` } `json:"sdm.devices.traits.ThermostatEco"` ThermostatHvac struct { Status string `json:"status"` } `json:"sdm.devices.traits.ThermostatHvac"` ThermostatMode struct { AvailableModes []string `json:"availableModes"` Mode string `json:"mode"` } `json:"sdm.devices.traits.ThermostatMode"` ThermostatTemperatureSetpoint struct { HeatCelsius float64 `json:"heatCelsius"` } `json:"sdm.devices.traits.ThermostatTemperatureSetpoint"` }
Click to show internal directories.
Click to hide internal directories.