Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) DeleteOverlay(in *DeleteOverlayInput) (*DeleteOverlayOutput, error)
- func (c *Client) GetDayReport(in *GetDayReportInput) (*GetDayReportOutput, error)
- func (c *Client) GetDevices(in *GetDevicesInput) (GetDevicesOutput, error)
- func (c *Client) GetHome(in *GetHomeInput) (*GetHomeOutput, error)
- func (c *Client) GetHomeState(in *GetHomeStateInput) (*GetHomeStateOutput, error)
- func (c *Client) GetMe() (*GetMeOutput, error)
- func (c *Client) GetUsers(in *GetUsersInput) (GetUsersOutput, error)
- func (c *Client) GetWeather(in *GetWeatherInput) (*GetWeatherOutput, error)
- func (c *Client) GetZoneState(in *GetZoneStateInput) (*GetZoneStateOutput, error)
- func (c *Client) GetZones(in *GetZonesInput) (GetZonesOutput, error)
- func (c *Client) PutOverlay(in *PutOverlayInput) (*PutOverlayOutput, error)
- type DayReport
- type DeleteOverlayInput
- type DeleteOverlayOutput
- type Device
- type GetDayReportInput
- type GetDayReportOutput
- type GetDevicesInput
- type GetDevicesOutput
- type GetHomeInput
- type GetHomeOutput
- type GetHomeStateInput
- type GetHomeStateOutput
- type GetMeInput
- type GetMeOutput
- type GetUsersInput
- type GetUsersOutput
- type GetWeatherInput
- type GetWeatherOutput
- type GetZoneStateInput
- type GetZoneStateOutput
- type GetZonesInput
- type GetZonesOutput
- type Home
- type HomeState
- type Me
- type OverlayInput
- type OverlayInputSetting
- type OverlayInputTemperature
- type OverlayInputTermination
- type OverlayOutput
- type PutOverlayInput
- type PutOverlayOutput
- type TerminationType
- type User
- type Weather
- type Zone
- type ZoneState
Constants ¶
const ( // HomeStateHome is the value of presence used when home HomeStateHome = "HOME" // HomeStateAway is the value of presence used when away HomeStateAway = "AWAY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the main client used to communicate with the Tado API.
func (*Client) DeleteOverlay ¶
func (c *Client) DeleteOverlay(in *DeleteOverlayInput) (*DeleteOverlayOutput, error)
DeleteOverlay deletes an overlay for a zone.
func (*Client) GetDayReport ¶
func (c *Client) GetDayReport(in *GetDayReportInput) (*GetDayReportOutput, error)
GetDayReport returns a detailed zone report of a specific date.
func (*Client) GetDevices ¶
func (c *Client) GetDevices(in *GetDevicesInput) (GetDevicesOutput, error)
GetDevices returns the devices in a home.
func (*Client) GetHome ¶
func (c *Client) GetHome(in *GetHomeInput) (*GetHomeOutput, error)
GetHome returns the Home data for a single home.
func (*Client) GetHomeState ¶
func (c *Client) GetHomeState(in *GetHomeStateInput) (*GetHomeStateOutput, error)
GetHomeState returns the presence state for a single home.
func (*Client) GetMe ¶
func (c *Client) GetMe() (*GetMeOutput, error)
GetMe returns the users data from the API.
func (*Client) GetUsers ¶
func (c *Client) GetUsers(in *GetUsersInput) (GetUsersOutput, error)
GetUsers returns the users in a home.
func (*Client) GetWeather ¶
func (c *Client) GetWeather(in *GetWeatherInput) (*GetWeatherOutput, error)
GetWeather returns the weather info for a home.
func (*Client) GetZoneState ¶
func (c *Client) GetZoneState(in *GetZoneStateInput) (*GetZoneStateOutput, error)
GetZoneState returns the state for a single zone within a home.
func (*Client) GetZones ¶
func (c *Client) GetZones(in *GetZonesInput) (GetZonesOutput, error)
GetZones returns the zones for a single home.
func (*Client) PutOverlay ¶
func (c *Client) PutOverlay(in *PutOverlayInput) (*PutOverlayOutput, error)
PutOverlay sets an overlay in a zone, it can be used to contol settings overruling a schema. For example to set the heating or hot water.
type DayReport ¶
type DayReport struct {
ZoneType string `json:"zoneType"`
Interval struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
} `json:"interval"`
HoursInDay int `json:"hoursInDay"`
MeasuredData struct {
MeasuringDeviceConnected struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
DataIntervals []struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
Value bool `json:"value"`
} `json:"dataIntervals"`
} `json:"measuringDeviceConnected"`
InsideTemperature struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
Min struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"min"`
Max struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"max"`
DataPoints []struct {
Timestamp time.Time `json:"timestamp"`
Value struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"value"`
} `json:"dataPoints"`
} `json:"insideTemperature"`
Humidity struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
PercentageUnit string `json:"percentageUnit"`
Min float64 `json:"min"`
Max float64 `json:"max"`
DataPoints []struct {
Timestamp time.Time `json:"timestamp"`
Value float64 `json:"value"`
} `json:"dataPoints"`
} `json:"humidity"`
} `json:"measuredData"`
Stripes struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
DataIntervals []struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
Value struct {
StripeType string `json:"stripeType"`
Setting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"setting"`
} `json:"value"`
} `json:"dataIntervals"`
} `json:"stripes"`
Settings struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
DataIntervals []struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
Value struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"value"`
} `json:"dataIntervals"`
} `json:"settings"`
CallForHeat struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
DataIntervals []struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
Value string `json:"value"`
} `json:"dataIntervals"`
} `json:"callForHeat"`
Weather struct {
Condition struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
DataIntervals []struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
Value struct {
State string `json:"state"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"value"`
} `json:"dataIntervals"`
} `json:"condition"`
Sunny struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
DataIntervals []struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
Value bool `json:"value"`
} `json:"dataIntervals"`
} `json:"sunny"`
Slots struct {
TimeSeriesType string `json:"timeSeriesType"`
ValueType string `json:"valueType"`
Slots struct {
Zero400 struct {
State string `json:"state"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"04:00"`
Zero800 struct {
State string `json:"state"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"08:00"`
One200 struct {
State string `json:"state"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"12:00"`
One600 struct {
State string `json:"state"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"16:00"`
Two000 struct {
State string `json:"state"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"20:00"`
} `json:"slots"`
} `json:"slots"`
} `json:"weather"`
}
DayReport contains the daily report info
type DeleteOverlayInput ¶
DeleteOverlayInput is the input for DeleteOverlay
type DeleteOverlayOutput ¶
type DeleteOverlayOutput struct{}
DeleteOverlayOutput is the output for DeleteOverlay
type Device ¶
type Device struct {
DeviceType string `json:"deviceType"`
SerialNo string `json:"serialNo"`
ShortSerialNo string `json:"shortSerialNo"`
CurrentFwVersion string `json:"currentFwVersion"`
ConnectionState struct {
Value bool `json:"value"`
Timestamp time.Time `json:"timestamp"`
} `json:"connectionState"`
Characteristics struct {
Capabilities []string `json:"capabilities"`
} `json:"characteristics"`
InPairingMode bool `json:"inPairingMode,omitempty"`
MountingState struct {
Value string `json:"value"`
Timestamp time.Time `json:"timestamp"`
} `json:"mountingState,omitempty"`
BatteryState string `json:"batteryState,omitempty"`
}
type GetDayReportInput ¶
GetDayReportInput is the input for GetDayReport
type GetDayReportOutput ¶
type GetDayReportOutput struct {
DayReport
}
GetDayReportOutput is the output for GetDayReport
type GetDevicesInput ¶
type GetDevicesInput struct {
HomeID int
}
GetDevicesInput is the input for GetDevices
type GetDevicesOutput ¶
type GetDevicesOutput []Device
GetDevicesOutput is the output for GetDevices
type GetHomeStateInput ¶
type GetHomeStateInput struct {
HomeID int
}
GetHomeStateInput is the input for GetHomeState
type GetHomeStateOutput ¶
type GetHomeStateOutput struct {
HomeState
}
GetHomeStateOutput is the output for GetHomeState
type GetUsersInput ¶
type GetUsersInput struct {
HomeID int
}
GetUsersInput is the input for GetUsers
type GetWeatherInput ¶
type GetWeatherInput struct {
HomeID int
}
GetWeatherInput is the input for GetWeather
type GetWeatherOutput ¶
type GetWeatherOutput struct {
Weather
}
GetWeatherOutput is the output for GetWeather
type GetZoneStateInput ¶
GetZoneStateInput is the input for GetZoneState
type GetZoneStateOutput ¶
type GetZoneStateOutput struct {
ZoneState
}
GetZoneStateOutput is the output for GetZoneState
type GetZonesInput ¶
type GetZonesInput struct {
HomeID int
}
GetZonesInput is the input for GetZones
type Home ¶
type Home struct {
ID int `json:"id"`
Name string `json:"name"`
DateTimeZone string `json:"dateTimeZone"`
DateCreated time.Time `json:"dateCreated"`
TemperatureUnit string `json:"temperatureUnit"`
InstallationCompleted bool `json:"installationCompleted"`
Partner string `json:"partner"`
SimpleSmartScheduleEnabled bool `json:"simpleSmartScheduleEnabled"`
AwayRadiusInMeters float64 `json:"awayRadiusInMeters"`
UsePreSkillsApps bool `json:"usePreSkillsApps"`
Skills []interface{} `json:"skills"` // TODO
ChristmasModeEnabled bool `json:"christmasModeEnabled"`
ShowAutoAssistReminders bool `json:"showAutoAssistReminders"`
ContactDetails struct {
Name string `json:"name"`
Email string `json:"email"`
Phone string `json:"phone"`
} `json:"contactDetails"`
Address struct {
AddressLine1 string `json:"addressLine1"`
AddressLine2 string `json:"addressLine2"`
ZipCode string `json:"zipCode"`
City string `json:"city"`
State string `json:"state"`
Country string `json:"country"`
} `json:"address"`
Geolocation struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
} `json:"geolocation"`
ConsentGrantSkippable bool `json:"consentGrantSkippable"`
}
Home is the info for a single home
type HomeState ¶
type HomeState struct {
Presence string `json:"presence"`
}
HomeState is the state of a home
type Me ¶
type Me struct {
Name string `json:"name"`
Email string `json:"email"`
Username string `json:"username"`
ID string `json:"id"`
Homes []struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"homes"`
Locale string `json:"locale"`
MobileDevices []struct {
Name string `json:"name"`
ID int `json:"id"`
Settings struct {
GeoTrackingEnabled bool `json:"geoTrackingEnabled"`
} `json:"settings"`
DeviceMetadata struct {
Platform string `json:"platform"`
OsVersion string `json:"osVersion"`
Model string `json:"model"`
Locale string `json:"locale"`
} `json:"deviceMetadata"`
} `json:"mobileDevices"`
}
Me contains the users data
type OverlayInput ¶
type OverlayInput struct {
Setting OverlayInputSetting `json:"setting"`
Termination OverlayInputTermination `json:"termination"`
}
OverlayInput is the main input for an overlay
type OverlayInputSetting ¶
type OverlayInputSetting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature OverlayInputTemperature `json:"temperature"`
}
OverlayInputSetting contains the settings for the overlay
type OverlayInputTemperature ¶
type OverlayInputTemperature struct {
Celsius float64 `json:"celsius,omitempty"`
Fahrenheit float64 `json:"fahrenheit,omitempty"`
}
OverlayInputTemperature contains the temperature settings for the overlay
type OverlayInputTermination ¶
type OverlayInputTermination struct {
Type TerminationType `json:"type"`
DurationInSeconds int `json:"durationInSeconds,omitempty"`
}
OverlayInputTermination contains the termination settings for the overlay
type OverlayOutput ¶
type OverlayOutput struct {
Type string `json:"type"`
Setting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"setting"`
Termination struct {
Type string `json:"type"`
TypeSkillBasedApp string `json:"typeSkillBasedApp"`
DurationInSeconds int `json:"durationInSeconds"`
Expiry time.Time `json:"expiry"`
RemainingTimeInSeconds int `json:"remainingTimeInSeconds"`
ProjectedExpiry time.Time `json:"projectedExpiry"`
} `json:"termination"`
}
OverlayOutput is the output for a successful overlay update
type PutOverlayInput ¶
type PutOverlayInput struct {
HomeID int
ZoneID int
OverlayInput
}
PutOverlayInput is the input for PutOverlay
type PutOverlayOutput ¶
type PutOverlayOutput struct {
OverlayOutput
}
PutOverlayOutput is the output for PutOverlay
type TerminationType ¶
type TerminationType string
TerminationType is an enum type for overlay termination types
const ( //TerminationTypeManual is used for manual termination TerminationTypeManual TerminationType = "MANUAL" // TerminationTypeTimer is used for automation termination, use property DurationInSeconds to set the timer duration TerminationTypeTimer TerminationType = "TIMER" // TerminationTypeTadoMode is used to terminate this setting by Tado, the overlay ends when the schema changes TerminationTypeTadoMode TerminationType = "TADO_MODE" )
type User ¶
type User struct {
Name string `json:"name"`
Email string `json:"email"`
Username string `json:"username"`
ID string `json:"id"`
Homes []struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"homes"`
Locale string `json:"locale"`
MobileDevices []struct {
Name string `json:"name"`
ID int `json:"id"`
Settings struct {
GeoTrackingEnabled bool `json:"geoTrackingEnabled"`
} `json:"settings"`
DeviceMetadata struct {
Platform string `json:"platform"`
OsVersion string `json:"osVersion"`
Model string `json:"model"`
Locale string `json:"locale"`
} `json:"deviceMetadata"`
} `json:"mobileDevices"`
}
type Weather ¶
type Weather struct {
SolarIntensity struct {
Type string `json:"type"`
Percentage float64 `json:"percentage"`
Timestamp time.Time `json:"timestamp"`
} `json:"solarIntensity"`
OutsideTemperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
Timestamp time.Time `json:"timestamp"`
Type string `json:"type"`
Precision struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"precision"`
} `json:"outsideTemperature"`
WeatherState struct {
Type string `json:"type"`
Value string `json:"value"`
Timestamp time.Time `json:"timestamp"`
} `json:"weatherState"`
}
Weather is the weather info for a home
type Zone ¶
type Zone struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
DateCreated time.Time `json:"dateCreated"`
DeviceTypes []string `json:"deviceTypes"`
Devices []struct {
DeviceType string `json:"deviceType"`
SerialNo string `json:"serialNo"`
ShortSerialNo string `json:"shortSerialNo"`
CurrentFwVersion string `json:"currentFwVersion"`
ConnectionState struct {
Value bool `json:"value"`
Timestamp time.Time `json:"timestamp"`
} `json:"connectionState"`
Characteristics struct {
Capabilities []string `json:"capabilities"`
} `json:"characteristics"`
MountingState struct {
Value string `json:"value"`
Timestamp time.Time `json:"timestamp"`
} `json:"mountingState"`
BatteryState string `json:"batteryState"`
Duties []string `json:"duties"`
} `json:"devices"`
ReportAvailable bool `json:"reportAvailable"`
SupportsDazzle bool `json:"supportsDazzle"`
DazzleEnabled bool `json:"dazzleEnabled"`
DazzleMode struct {
Supported bool `json:"supported"`
Enabled bool `json:"enabled"`
} `json:"dazzleMode"`
OpenWindowDetection struct {
Supported bool `json:"supported"`
Enabled bool `json:"enabled"`
TimeoutInSeconds int `json:"timeoutInSeconds"`
} `json:"openWindowDetection"`
}
Zone contains info about a single zone
type ZoneState ¶
type ZoneState struct {
TadoMode string `json:"tadoMode"`
GeolocationOverride bool `json:"geolocationOverride"`
GeolocationOverrideDisableTime interface{} `json:"geolocationOverrideDisableTime"` // TODO
Preparation interface{} `json:"preparation"` // TODO
Setting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"setting"`
OverlayType string `json:"overlayType"`
Overlay struct {
Type string `json:"type"`
Setting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"setting"`
Termination struct {
Type string `json:"type"`
TypeSkillBasedApp string `json:"typeSkillBasedApp"`
DurationInSeconds int `json:"durationInSeconds"`
Expiry time.Time `json:"expiry"`
RemainingTimeInSeconds int `json:"remainingTimeInSeconds"`
ProjectedExpiry time.Time `json:"projectedExpiry"`
} `json:"termination"`
} `json:"overlay"`
OpenWindow interface{} `json:"openWindow"` // TODO
NextScheduleChange struct {
Start time.Time `json:"start"`
Setting struct {
Type string `json:"type"`
Power string `json:"power"`
Temperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"temperature"`
} `json:"setting"`
} `json:"nextScheduleChange"`
NextTimeBlock struct {
Start time.Time `json:"start"`
} `json:"nextTimeBlock"`
Link struct {
State string `json:"state"`
} `json:"link"`
ActivityDataPoints struct {
HeatingPower struct {
Type string `json:"type"`
Percentage float64 `json:"percentage"`
Timestamp time.Time `json:"timestamp"`
} `json:"heatingPower"`
} `json:"activityDataPoints"`
SensorDataPoints struct {
InsideTemperature struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
Timestamp time.Time `json:"timestamp"`
Type string `json:"type"`
Precision struct {
Celsius float64 `json:"celsius"`
Fahrenheit float64 `json:"fahrenheit"`
} `json:"precision"`
} `json:"insideTemperature"`
Humidity struct {
Type string `json:"type"`
Percentage float64 `json:"percentage"`
Timestamp time.Time `json:"timestamp"`
} `json:"humidity"`
} `json:"sensorDataPoints"`
}
ZoneState is the state of a single zone
