gotado

package module
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 16 Imported by: 2

README

gotado

Build Actions Status Go Report Card PkgGoDev

Go client for the tado° Web API. Still in early development, so only a subset of the API functionality is implemented.

Installation

Install gotado with go get:

go get github.com/gonzolino/gotado

Then you can import "github.com/gonzolino/gotado" in your packages. Have a look at the examples directory to see example code.

Usage

Authentication

Besides your tado° username and password you need a clientId and clientSecret to authenticate with the tado° API. One way to get those is to grab them from https://my.tado.com/webapp/env.js.

Getting Started

Get started by creating a client object:

tado := gotado.New("cliendId", "clientSecret")

With the client you can authenticate and start using the gotado functions:

me, err := tado.Me(ctx, "username", "password")
fmt.Printf("User Email: %s\n", me.Email)

home, err := me.GetHome(client, "My Home Name")
fmt.Printf("Home Address:\n%s\n%s %s\n", *home.Address.AddressLine1, *home.Address.ZipCode, *home.Address.City)

Just have a look at the package documentation to learn more about whats possible.

Contributing

Please feel free to submit issues and/or pull requests if you discover bugs or missing features.

Documentation

Index

Constants

View Source
const (
	ZoneTypeHeating  = "HEATING"
	ZoneTypeHotWater = "HOT_WATER"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AwayConfiguration

type AwayConfiguration struct {
	Type         ZoneType     `json:"type"`
	AutoAdjust   bool         `json:"autoAdjust"`
	ComfortLevel ComfortLevel `json:"comfortLevel"`
	Setting      *ZoneSetting `json:"setting"`
}

AwayConfiguration holds the settings to use when everybody leaves the house

type ComfortLevel

type ComfortLevel int32

ComfortLevel defines how a zone is preheated before arrival

const (
	// ComfortLevelEco will not preheat the zone too early before arrival and only reach the target temperature after arrival
	ComfortLevelEco ComfortLevel = 0
	// ComfortLevelBalance will find the best trade-off between comfort and savings
	ComfortLevelBalance ComfortLevel = 50
	// ComfortLevelComfort ensures that the desired home temperature is reached shortly before arrival
	ComfortLevelComfort ComfortLevel = 100
)

type DayType

type DayType string

DayType specifies the type of day for a heating schedule block

const (
	DayTypeMondayToSunday DayType = "MONDAY_TO_SUNDAY"
	DayTypeMondayToFriday DayType = "MONDAY_TO_FRIDAY"
	DayTypeMonday         DayType = "MONDAY"
	DayTypeTuesday        DayType = "TUESDAY"
	DayTypeWednesday      DayType = "WEDNESDAY"
	DayTypeThursday       DayType = "THURSDAY"
	DayTypeFriday         DayType = "FRIDAY"
	DayTypeSaturday       DayType = "SATURDAY"
	DayTypeSunday         DayType = "SUNDAY"
)

type DazzleMode added in v2.1.0

type DazzleMode struct {
	Enabled bool `json:"enabled"`
}

DazzleMode controls whether dazzle mode is enabled or not.

type Device

type Device struct {
	DeviceType       DeviceType            `json:"deviceType"`
	SerialNo         string                `json:"serialNo"`
	ShortSerialNo    string                `json:"shortSerialNo"`
	CurrentFwVersion string                `json:"currentFwVersion"`
	ConnectionState  DeviceConnectionState `json:"connectionState"`
	Characteristics  DeviceCharacteristics `json:"characteristics"`
	InPairingMode    *bool                 `json:"inPairingMode,omitempty"`
	MountingState    *DeviceMountingState  `json:"mountingState,omitempty"`
	BatteryState     *string               `json:"batteryState,omitempty"`
	ChildLockEnabled *bool                 `json:"childLockEnabled,omitempty"`
	GatewayOperation *string               `json:"gatewayOperation,omitempty"`
	Duties           []string              `json:"duties,omitempty"`
	// contains filtered or unexported fields
}

Device represents a tado° device such as a thermostat or a bridge

func (*Device) GetTemperatureOffset

func (d *Device) GetTemperatureOffset(ctx context.Context) (float32, error)

GetTemperatureOffset returns the temperature offsets of the device

func (*Device) SetTemperatureOffset added in v2.1.0

func (d *Device) SetTemperatureOffset(ctx context.Context, temperatureOffset float32) error

SetTemperatureOffset updates the temperature offsets of the device

type DeviceCharacteristics

type DeviceCharacteristics struct {
	Capabilities []string `json:"capabilities"`
}

DeviceCharacteristics lists the capabilities of a device

type DeviceConnectionState

type DeviceConnectionState struct {
	Value     bool      `json:"value"`
	Timestamp time.Time `json:"timestamp"`
}

DeviceConnectionState specifies if the device is connected or not

type DeviceMountingState

type DeviceMountingState struct {
	Value     string    `json:"value"`
	Timestamp time.Time `json:"timestamp"`
}

DeviceMountingState holds the mounting state of a device, e.g. if it is calibrated

type DeviceType

type DeviceType string

DeviceType defines the type of a device

const (
	DeviceTypeInternetBridge               DeviceType = "IB01"
	DeviceTypeExtensionKit01               DeviceType = "BU01"
	DeviceTypeExtensionKit02               DeviceType = "BU02"
	DeviceTypeSmartACControl01             DeviceType = "WR01"
	DeviceTypeSmartACControl02             DeviceType = "WR02"
	DeviceTypeSmartThermostat01            DeviceType = "RU01"
	DeviceTypeSmartThermostat02            DeviceType = "RU02"
	DeviceTypeSmartRadiatorThermostat01    DeviceType = "VA01"
	DeviceTypeSmartRadiatorThermostat02    DeviceType = "VA02"
	DeviceTypeWirelessTemperatureSensor01  DeviceType = "SU02"
	DeviceTypeWirelessReceiverProgrammer01 DeviceType = "BP02"
	DeviceTypeWirelessReceiverBoiler01     DeviceType = "BR02"
)

type EarlyStart

type EarlyStart struct {
	Enabled bool `json:"enabled"`
}

EarlyStart controls whether tado° ensures that a set temperature is reached at the start of a block.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type HeatingSchedule

type HeatingSchedule struct {
	ScheduleDays ScheduleDays
	Timetable    *ScheduleTimetable
	Blocks       []*ScheduleTimeBlock
	// contains filtered or unexported fields
}

func (*HeatingSchedule) AddTimeBlock

func (s *HeatingSchedule) AddTimeBlock(_ context.Context, dayType DayType, start, end string, geolocationOverride bool, power Power, temperature float64) *HeatingSchedule

AddTimeBlock adds a time block to the heating schedule. Start and end parameters define when the time blocks starts and ends and are in the format HH:MM. GeolocationOverride specifies if the timeblock will override geofencing control. Power defines if heating is powered on or off and temperature specifies the temperature to heat to. Temperature is interpreted in Celsius / Fahrenheit depending on the temperature unit configured in the home.

func (*HeatingSchedule) NewTimeBlock

func (s *HeatingSchedule) NewTimeBlock(ctx context.Context, dayType DayType, start, end string, geolocationOverride bool, power Power, temperature float64) *HeatingSchedule

NewTimeBlock resets the list of time blocks in the heating schedule and adds the given time block as the first new block.

type Home

type Home struct {
	ID                         int32                 `json:"id"`
	Name                       string                `json:"name"`
	DateTimeZone               string                `json:"dateTimeZone"`
	DateCreated                time.Time             `json:"dateCreated"`
	TemperatureUnit            TemperatureUnit       `json:"temperatureUnit"`
	SimpleSmartScheduleEnabled bool                  `json:"simpleSmartScheduleEnabled"`
	AwayRadiusInmeters         float32               `json:"awayRadiusInMeters"`
	InstallationCompleted      bool                  `json:"installationCompleted"`
	IncidentDetection          HomeIncidentDetection `json:"incidentDetection"`
	AutoAssistFreeTrialEnabled bool                  `json:"autoAssistFreeTrialEnabled"`
	Skills                     []string              `json:"skills"`
	ChristmasModeEnabled       bool                  `json:"christmasModeEnabled"`
	ShowAutoAssistReminders    bool                  `json:"showAutoAssistReminders"`
	ContactDetails             HomeContactDetails    `json:"contactDetails"`
	Address                    HomeAddress           `json:"address"`
	Geolocation                HomeGeolocation       `json:"geolocation"`
	ConsentGrantSkippable      bool                  `json:"consentGrantSkippable"`
	// contains filtered or unexported fields
}

Home represents a home equipped with tado°

func (*Home) GetDevices

func (h *Home) GetDevices(ctx context.Context) ([]*Device, error)

GetDevices lists all devices in the home

func (*Home) GetInstallations

func (h *Home) GetInstallations(ctx context.Context) ([]*Installation, error)

GetInstallations lists all installations in the home

func (*Home) GetMobileDevices

func (h *Home) GetMobileDevices(ctx context.Context) ([]*MobileDevice, error)

GetMobileDevices lists all mobile devices linked to the home

func (*Home) GetState

func (h *Home) GetState(ctx context.Context) (*HomeState, error)

GetState returns the state of the home

func (*Home) GetUsers

func (h *Home) GetUsers(ctx context.Context) ([]*User, error)

GetUsers lists all users and their mobile devices linked to the home

func (*Home) GetWeather

func (h *Home) GetWeather(ctx context.Context) (*Weather, error)

GetWeather returns weather information at the homes location

func (*Home) GetZone

func (h *Home) GetZone(ctx context.Context, name string) (*Zone, error)

func (*Home) GetZones

func (h *Home) GetZones(ctx context.Context) ([]*Zone, error)

GetZones returns information about the zones in the home

func (*Home) SetPresenceAuto

func (h *Home) SetPresenceAuto(ctx context.Context) error

SetPresenceAuto enables geofencing auto mode.

func (*Home) SetPresenceAway

func (h *Home) SetPresenceAway(ctx context.Context) error

SetPresenceAway sets the geofencing presence to 'away'.

func (*Home) SetPresenceHome

func (h *Home) SetPresenceHome(ctx context.Context) error

SetPresenceHome sets the geofencing presence to 'at home'.

type HomeAddress

type HomeAddress 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"`
}

HomeAddress holds the address of a home

type HomeContactDetails

type HomeContactDetails struct {
	Name  *string `json:"name"`
	Email *string `json:"email"`
	Phone *string `json:"phone"`
}

HomeContactDetails holds the contact details for a home

type HomeGeolocation

type HomeGeolocation struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

HomeGeolocation holds the coordinates of a home

type HomeIncidentDetection

type HomeIncidentDetection struct {
	Supported bool `json:"supported"`
	Enabled   bool `json:"enabled"`
}

HomeIncidentDetection holds incident detection options for a home

type HomeState

type HomeState struct {
	Presence       Presence `json:"presence"`
	PresenceLocked bool     `json:"presenceLocked"`
}

HomeState represents the state of a tado° home

type Installation

type Installation struct {
	ID       int32    `json:"id"`
	Type     string   `json:"type"`
	Revision int32    `json:"revision"`
	State    string   `json:"state"`
	Devices  []Device `json:"devices"`
}

Installation holds information about a tado° hardware installation

type LinkState

type LinkState string

LinkState holds the state of a link (online or offline)

const (
	LinkStateOnline  LinkState = "ONLINE"
	LinkStateOffline LinkState = "OFFLINE"
)

type Measurement

type Measurement struct {
	Type      MeasurementType `json:"type"`
	Timestamp time.Time       `json:"timestamp"`
}

Measurement measures a value at a certain point in time. See MeasurementType for available types of measurements.

type MeasurementType

type MeasurementType string

MeasurementType specifies teh type of a measurement

const (
	MeasurementTypeTemperature MeasurementType = "TEMPERATURE"
	MeasurementTypePercentage  MeasurementType = "PERCENTAGE"
	MeasurementTypeWeather     MeasurementType = "WEATHER_STATE"
)

type MobileDevice

type MobileDevice struct {
	Name           string                `json:"name"`
	ID             int32                 `json:"id"`
	Settings       MobileDeviceSettings  `json:"settings"`
	Location       *MobileDeviceLocation `json:"location"`
	DeviceMetadata MobileDeviceMetadata  `json:"deviceMetadata"`
	// contains filtered or unexported fields
}

MobileDevice represents a mobile device with the tado° app installed

func (*MobileDevice) Delete

func (md *MobileDevice) Delete(ctx context.Context) error

Delete deletes the mobile device

func (*MobileDevice) SetSettings

func (md *MobileDevice) SetSettings(ctx context.Context, settings MobileDeviceSettings) error

SetSettings updates the mobile device with the given settings

type MobileDeviceLocation

type MobileDeviceLocation struct {
	Stale                         bool                                `json:"stale"`
	AtHome                        bool                                `json:"atHome"`
	BearingFromHome               MobileDeviceLocationBearingFromHome `json:"bearingFromHome"`
	RelativeDistanceFromHomeFence float64                             `json:"relativeDistanceFromHomeFence"`
}

MobileDeviceLocation holds information regarding the current location of mobile device

type MobileDeviceLocationBearingFromHome

type MobileDeviceLocationBearingFromHome struct {
	Degrees float64 `json:"degrees"`
	Radians float64 `json:"radians"`
}

MobileDeviceLocationBearingFromHome holds the current bearing of a mobile device from the home

type MobileDeviceMetadata

type MobileDeviceMetadata struct {
	Platform  string `json:"platform"`
	OSVersion string `json:"osVersion"`
	Model     string `json:"model"`
	Locale    string `json:"locale"`
}

MobileDeviceMetadata holds some general metadata about a mobile device

type MobileDeviceSettings

type MobileDeviceSettings struct {
	GeoTrackingEnabled bool                                   `json:"geoTrackingEnabled"`
	PushNotifications  *MobileDeviceSettingsPushNotifications `json:"pushNotifications,omitempty"`
}

MobileDeviceSettings holds the settings of a mobile device

type MobileDeviceSettingsPushNotifications

type MobileDeviceSettingsPushNotifications struct {
	LowBatteryReminder          bool `json:"lowBatteryReminder"`
	AwayModeReminder            bool `json:"awayModeReminder"`
	HomeModeReminder            bool `json:"homeModeReminder"`
	OpenWindowReminder          bool `json:"openWindowReminder"`
	EnergySavingsReportReminder bool `json:"energySavingsReportReminder"`
	IncidentDetection           bool `json:"incidentDetection"`
}

MobileDeviceSettingsPushNotifications holds the push notification settings

type OpenWindowDetection added in v2.1.0

type OpenWindowDetection struct {
	Enabled          bool  `json:"enabled"`
	TimeoutInSeconds int32 `json:"timeoutInSeconds,omitempty"`
}

OpenWindowDetection controls whether open window detection is enabled or not, and how long to shut off the heating after a window has been opened.

type OverlayType

type OverlayType string

OverlayType specifies the type of an overlay

const (
	// OverlayTypeManual remains active until ended by user
	OverlayTypeManual OverlayType = "MANUAL"
	// OverlayTypeAuto remains active until next automatic change
	OverlayTypeAuto OverlayType = "TADO_MODE"
	// OverlayTypeTimer remains active for a given duration
	OverlayTypeTimer OverlayType = "TIMER"
)

type PercentageMeasurement

type PercentageMeasurement struct {
	Measurement
	Percentage float64 `json:"percentage"`
}

PercentageMeasurement holds a measured percentage

type Power

type Power string

Power specifies is something is powered on or off

const (
	PowerOn  Power = "ON"
	PowerOff Power = "OFF"
)

type Presence

type Presence string

Presence defines if somebody is present at home

const (
	PresenceHome Presence = "HOME"
	PresenceAway Presence = "AWAY"
)

type PresenceLock

type PresenceLock struct {
	HomePresence Presence `json:"homePresence"`
}

PresenceLock holds a locked presence setting for a home

type ScheduleDays

type ScheduleDays string
const (
	ScheduleDaysMonToSun              ScheduleDays = ScheduleDays(TimetableOneDay)
	ScheduleDaysMonToFriSatSun        ScheduleDays = ScheduleDays(TimetableThreeDay)
	ScheduleDaysMonTueWedThuFriSatSun ScheduleDays = ScheduleDays(TimetableSevenDay)
)

type ScheduleTimeBlock

type ScheduleTimeBlock struct {
	DayType             DayType      `json:"dayType"`
	Start               string       `json:"start"`
	End                 string       `json:"end"`
	GeolocationOverride bool         `json:"geolocationOverride"`
	Setting             *ZoneSetting `json:"setting"`
}

ScheduleTimeBlock is a block in a tado° schedule

type ScheduleTimetable

type ScheduleTimetable struct {
	ID   int32         `json:"id"`
	Type TimetableType `json:"type,omitempty"`
	// contains filtered or unexported fields
}

ScheduleTimetable is the type of a tado° schedule timetable

func (*ScheduleTimetable) GetTimeBlocks

func (s *ScheduleTimetable) GetTimeBlocks(ctx context.Context) ([]*ScheduleTimeBlock, error)

GetTimeBlocks returns all time blocks of the schedule.

func (*ScheduleTimetable) SetTimeBlocks

func (s *ScheduleTimetable) SetTimeBlocks(ctx context.Context, blocks []*ScheduleTimeBlock) error

SetTimeBlocks updates the schedule with the given time blocks.

type Tado

type Tado struct {
	// contains filtered or unexported fields
}

func New

func New(clientID, clientSecret string) *Tado

New creates a new tado client.

func (*Tado) Me

func (t *Tado) Me(ctx context.Context, username, password string) (*User, error)

Me authenticates with the given credentials and returns information about the authenticated user.

type TemperatureMeasurement

type TemperatureMeasurement struct {
	Measurement
	Celsius    float64                         `json:"celsius"`
	Fahrenheit float64                         `json:"fahrenheit"`
	Precision  TemperatureMeasurementPrecision `json:"precision"`
}

TemperatureMeasurement holds a measured temperature

type TemperatureMeasurementPrecision

type TemperatureMeasurementPrecision struct {
	Celsius    float64 `json:"celsius"`
	Fahrenheit float64 `json:"fahrenheit"`
}

TemperatureMeasurementPrecision holds the precision of a temperature measurement

type TemperatureOffset

type TemperatureOffset struct {
	Celsius    float32 `json:"celsius"`
	Fahrenheit float32 `json:"fahrenheit"`
}

TemperatureOffset holds the current temperature offsets for a tado° device

type TemperatureUnit

type TemperatureUnit string

TemperatureUnit defines the unit in which a temperature is measured

const (
	TemperatureUnitCelsius    TemperatureUnit = "CELSIUS"
	TemperatureUnitFahrenheit TemperatureUnit = "FAHRENHEIT"
)

type TimetableType

type TimetableType string

TimetableType specifies the type of a timetable

const (
	// TimetableOneDay is a timetable type with a single schedule for all days
	TimetableOneDay TimetableType = "ONE_DAY"
	// TimetableThreeDay is a timetable type with a schedule for week days, saturdays and sundays
	TimetableThreeDay TimetableType = "THREE_DAY"
	// TimetableSevenDay is a timetable type with one schedule for each day
	TimetableSevenDay TimetableType = "SEVEN_DAY"
)

type User

type User struct {
	Name          string         `json:"name"`
	Email         string         `json:"email"`
	Username      string         `json:"username"`
	ID            string         `json:"id"`
	Homes         []UserHome     `json:"homes"`
	Locale        string         `json:"locale"`
	MobileDevices []MobileDevice `json:"mobileDevices"`
	// contains filtered or unexported fields
}

User represents a tado° user

func (*User) GetHome

func (u *User) GetHome(ctx context.Context, name string) (*Home, error)

GetHome returns the home with the given name

type UserHome

type UserHome struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

UserHome represents a home in a user object

type Weather

type Weather struct {
	SolarIntensity     *PercentageMeasurement  `json:"solarIntensity"`
	OutsideTemperature *TemperatureMeasurement `json:"outsideTemperature"`
	WeatherState       *WeatherMeasurement     `json:"weatherState"`
}

Weather holds weather information from the home's location

type WeatherMeasurement

type WeatherMeasurement struct {
	Measurement
	Value string `json:"value"`
}

WeatherMeasurement holds a measurement of the weather state

type Zone

type Zone struct {
	ID                  int32                   `json:"id"`
	Name                string                  `json:"name"`
	Type                ZoneType                `json:"type"`
	DateCreated         time.Time               `json:"dateCreated"`
	DeviceTypes         []DeviceType            `json:"deviceTypes"`
	Devices             []Device                `json:"devices"`
	ReportAvailable     bool                    `json:"reportAvailable"`
	SupportsDazzle      bool                    `json:"supportsDazzle"`
	DazzleEnabled       bool                    `json:"dazzleEnabled"`
	DazzleMode          ZoneDazzleMode          `json:"dazzleMode"`
	OpenWindowDetection ZoneOpenWindowDetection `json:"openWindowDetection"`
	// contains filtered or unexported fields
}

Zone represents a tado° zone

func (*Zone) CloseWindow

func (z *Zone) CloseWindow(ctx context.Context) error

CloseWindow ends open window mode in the zone.

func (*Zone) DisableDazzleMode added in v2.1.0

func (z *Zone) DisableDazzleMode(ctx context.Context) error

DisableDazzleMode disables dazzle mode in the zone.

func (*Zone) DisableOpenWindowDetection added in v2.1.0

func (z *Zone) DisableOpenWindowDetection(ctx context.Context) error

DisableOpenWindowDetection disable open window detection.

func (*Zone) EnableDazzleMode added in v2.1.0

func (z *Zone) EnableDazzleMode(ctx context.Context) error

EnableDazzleMode enables dazzle mode in the zone.

func (*Zone) EnableOpenWindowDetection added in v2.1.0

func (z *Zone) EnableOpenWindowDetection(ctx context.Context, timeout int32) error

EnableOpenWindowDetection enable open window detection with the given heating timeout duration in seconds after an open window has been detected.

func (*Zone) GetActiveScheduleTimetable

func (z *Zone) GetActiveScheduleTimetable(ctx context.Context) (*ScheduleTimetable, error)

GetActiveScheduleTimetable returns the active schedule timetable for the zone.

func (*Zone) GetAwayConfiguration

func (z *Zone) GetAwayConfiguration(ctx context.Context) (*AwayConfiguration, error)

GetAwayConfiguration returns the away configuration of the zone.

func (*Zone) GetCapabilities

func (z *Zone) GetCapabilities(ctx context.Context) (*ZoneCapabilities, error)

GetCapabilities returns the capabilities of the zone.

func (*Zone) GetDazzleMode added in v2.1.0

func (z *Zone) GetDazzleMode(ctx context.Context) (*ZoneDazzleMode, error)

GetDazzleMode returns the current dazzle mode settings.

func (*Zone) GetDevices

func (z *Zone) GetDevices(ctx context.Context) ([]*Device, error)

GetDevices lists all devices in the zone

func (*Zone) GetEarlyStart

func (z *Zone) GetEarlyStart(ctx context.Context) (bool, error)

GetEarlyStart checks if early start is enabled in the zone.

func (*Zone) GetHeatingSchedule

func (z *Zone) GetHeatingSchedule(ctx context.Context) (*HeatingSchedule, error)

GetHeatingSchedule gets the whole active schedule for the zone, including active timetable and time blocks.

func (*Zone) GetManualControlTerminationCondition added in v2.1.0

func (z *Zone) GetManualControlTerminationCondition(ctx context.Context) (*ZoneOverlayTermination, error)

GetManualControlTerminationCondition returns the condition how long manual control in the zone will remain active after a tado° device was controlled manually.

func (*Zone) GetOpenWindowDetection added in v2.1.0

func (z *Zone) GetOpenWindowDetection(ctx context.Context) (*OpenWindowDetection, error)

GetOpenWindowDetection returns the current open window detection settings.

func (*Zone) GetState

func (z *Zone) GetState(ctx context.Context) (*ZoneState, error)

GetState returns the state of the zone.

func (*Zone) ManualControlTimer added in v2.1.0

func (z *Zone) ManualControlTimer(ctx context.Context, duration int32) error

ManualControlTimer ensures that manual control of the zone remains active for the given duration in seconds.

func (*Zone) ManualControlUntilAutoChange added in v2.1.0

func (z *Zone) ManualControlUntilAutoChange(ctx context.Context) error

ManualControlUntilAutoChange ensures that manual control of the zone remains active until the next automatic change in the tado° schedule.

func (*Zone) ManualControlUntilUserEnd added in v2.1.0

func (z *Zone) ManualControlUntilUserEnd(ctx context.Context) error

ManualControlUntilUserEnd ensures that manual control of the zone remains active until ended by the user.

func (*Zone) OpenWindow

func (z *Zone) OpenWindow(ctx context.Context) error

OpenWindow puts the zone into open window mode (open window must have been detected by tado° beforehand).

func (*Zone) ResumeSchedule

func (z *Zone) ResumeSchedule(ctx context.Context) error

ResumeSchedule resumes the zone's smart schedule.

func (*Zone) ScheduleAllDays

func (z *Zone) ScheduleAllDays(ctx context.Context) (*HeatingSchedule, error)

ScheduleAllDays has a different schedule for each day of the week.

func (*Zone) ScheduleMonToFriSatSun

func (z *Zone) ScheduleMonToFriSatSun(ctx context.Context) (*HeatingSchedule, error)

TimetableTMonToFriSatSun has the same schedule for all days between monday and friday and different schedules for saturday and sunday.

func (*Zone) ScheduleMonToSun

func (z *Zone) ScheduleMonToSun(ctx context.Context) (*HeatingSchedule, error)

ScheduleMonToSun has the same schedule for all days between monday and sunday.

func (*Zone) SetActiveScheduleTimetable

func (z *Zone) SetActiveScheduleTimetable(ctx context.Context, timetable *ScheduleTimetable) error

SetActiveScheduleTimetable sets the active schedule timetable for the zone. Should be one of TimetableMonToSun(), TimetableMonToFriSatSun() or TimetableAllDays(),

func (*Zone) SetAwayConfiguration

func (z *Zone) SetAwayConfiguration(ctx context.Context, awayConfig *AwayConfiguration) error

SetAwayConfiguration updates the away configuration of the zone.

func (*Zone) SetAwayMinimumTemperature

func (z *Zone) SetAwayMinimumTemperature(ctx context.Context, temperature float64) error

SetAwayMinimumTemperature sets the minimum temperature for away mode in the zone.

func (*Zone) SetAwayPreheatComfortLevel

func (z *Zone) SetAwayPreheatComfortLevel(ctx context.Context, comfortLevel ComfortLevel) error

SetAwayPreheatComfortLevel sets the comfort level for preheating before arrival.

func (*Zone) SetAwayPreheatOff

func (z *Zone) SetAwayPreheatOff(ctx context.Context) error

SetAwayPreheatOff turns off preheat before arrival. Tado° will only start heating after arrival. To turn preheating back on, use SetAwayPreheatComfortLevel().

func (*Zone) SetEarlyStart

func (z *Zone) SetEarlyStart(ctx context.Context, earlyStart bool) error

SetEarlyStart enables or disables early start in the zone.

func (*Zone) SetHeatingOff

func (z *Zone) SetHeatingOff(ctx context.Context) error

SetHeatingOff turns off the heating in the zone.

func (*Zone) SetHeatingOn

func (z *Zone) SetHeatingOn(ctx context.Context, temperature float64) error

SetHeatingOn turns on the heating in the zone. The temperature should use the unit configured for the home.

func (*Zone) SetHeatingSchedule

func (z *Zone) SetHeatingSchedule(ctx context.Context, schedule *HeatingSchedule) error

SetHeatingSchedule sets the whole active schedule for the zone, including active timetable and time blocks.

func (*Zone) SetManualControlTerminationCondition added in v2.1.0

func (z *Zone) SetManualControlTerminationCondition(ctx context.Context, condition *ZoneOverlayTermination) error

SetManualControlTerminationCondition sets the given manual control termination condition. Possible types for the condition are "MANUAL" (Until ended by user), "TIMER" and "TADO_MODE" (Until next automatic change).

type ZoneCapabilities

type ZoneCapabilities struct {
	Type              ZoneType                      `json:"type"`
	CanSetTemperature *bool                         `json:"canSetTemperature,omitempty"`
	Temperatures      *ZoneCapabilitiesTemperatures `json:"temperatures,omitempty"`
}

ZoneCapabilities stores the capabilities of a zone, such as the supported min/max temperatures

type ZoneCapabilitiesTemperatureValues

type ZoneCapabilitiesTemperatureValues struct {
	Min  int32   `json:"min"`
	Max  int32   `json:"max"`
	Step float32 `json:"step"`
}

ZoneCapabilitiesTemperatureValues holds the numeric values of temperature related capabilities of a zone

type ZoneCapabilitiesTemperatures

type ZoneCapabilitiesTemperatures struct {
	Celsius    *ZoneCapabilitiesTemperatureValues `json:"celsius,omitempty"`
	Fahrenheit *ZoneCapabilitiesTemperatureValues `json:"fahrenheit,omitempty"`
}

ZoneCapabilitiesTemperatures holds the temperature related capabilities of a zone

type ZoneDazzleMode

type ZoneDazzleMode struct {
	Supported bool `json:"supported"`
	Enabled   bool `json:"enabled"`
}

ZoneDazzleMode holds information about dazzle mode in a zone

type ZoneDefaultOverlay added in v2.1.0

type ZoneDefaultOverlay struct {
	TerminationCondition *ZoneOverlayTermination `json:"terminationCondition"`
}

ZoneDefaultOverlay holds the default overlay information of a zone

type ZoneOpenWindowDetection

type ZoneOpenWindowDetection struct {
	Supported        bool  `json:"supported"`
	Enabled          bool  `json:"enabled"`
	TimeoutInSeconds int32 `json:"timeoutInSeconds"`
}

ZoneOpenWindowDetection holds information about open window detection in a zone

type ZoneOverlay

type ZoneOverlay struct {
	Type        OverlayType             `json:"type,omitempty"`
	Setting     *ZoneSetting            `json:"setting"`
	Termination *ZoneOverlayTermination `json:"termination,omitempty"`
}

ZoneOverlay holds overlay information of a zone

type ZoneOverlayTermination

type ZoneOverlayTermination struct {
	Type                   OverlayType `json:"type"`
	TypeSkillBasedApp      string      `json:"typeSkillBasedApp,omitempty"`
	DurationInSeconds      int32       `json:"durationInSeconds,omitempty"`
	Expiry                 string      `json:"expiry,omitempty"`
	RemainingTimeInSeconds int32       `json:"remainingTimeInSeconds,omitempty"`
	ProjectedExpiry        *string     `json:"projectedExpiry,omitempty"`
}

ZoneOverlayTermination holdes the termination information of a zone overlay

type ZoneSetting

type ZoneSetting struct {
	Type        ZoneType                `json:"type"`
	Power       Power                   `json:"power"`
	Temperature *ZoneSettingTemperature `json:"temperature"`
}

ZoneSetting holds the setting of a zone

type ZoneSettingTemperature

type ZoneSettingTemperature struct {
	Celsius    float64 `json:"celsius"`
	Fahrenheit float64 `json:"fahrenheit"`
}

ZoneSettingTemperature holds the temperature of a zone state setting

type ZoneState

type ZoneState struct {
	TadoMode                       string                        `json:"tadoMode"`
	GeolocationOverride            bool                          `json:"geolocationOverride"`
	GeolocationOverrideDisableTime *string                       `json:"geolocationOverrideDisableTime"`
	Setting                        ZoneSetting                   `json:"setting"`
	OverlayType                    *OverlayType                  `json:"overlayType"`
	Overlay                        *ZoneOverlay                  `json:"overlay"`
	OpenWindow                     *ZoneStateOpenWindow          `json:"openWindow"`
	OpenWindowDetected             bool                          `json:"openWindowDetected"`
	NextScheduledChange            *ZoneStateNextScheduledChange `json:"nextScheduleChange"`
	NextTimeBlock                  *ZoneStateNextTimeBlock       `json:"nextTimeBlock"`
	Link                           ZoneStateLink                 `json:"link"`
	ActivityDataPoints             *ZoneStateActivityDataPoints  `json:"activityDataPoints"`
	SensorDataPoints               *ZoneStateSensorDataPoints    `json:"sensorDataPoints"`
}

ZoneState represents the state of a tado° zone

type ZoneStateActivityDataPoints

type ZoneStateActivityDataPoints struct {
	HeatingPower *PercentageMeasurement `json:"heatingPower"`
}

ZoneStateActivityDataPoints holds activity data points for a zone

type ZoneStateLink struct {
	State  string              `json:"state"`
	Reason ZoneStateLinkReason `json:"reason,omitempty"`
}

ZoneStateLink holds the link information of a tado zone

type ZoneStateLinkReason

type ZoneStateLinkReason struct {
	Code  string `json:"code"`
	Title string `json:"title"`
}

ZoneStateLinkReason holds the reason why a link is offline

type ZoneStateNextScheduledChange

type ZoneStateNextScheduledChange struct {
	Start   time.Time    `json:"start"`
	Setting *ZoneSetting `json:"setting"`
}

ZoneStateNextScheduledChange holds start time and settings of the next scheduled change

type ZoneStateNextTimeBlock

type ZoneStateNextTimeBlock struct {
	Start time.Time `json:"start"`
}

ZoneStateNextTimeBlock holds the start time of the next time block

type ZoneStateOpenWindow

type ZoneStateOpenWindow struct {
	DetectedTime           string `json:"detectedTime"`
	DurationInSeconds      int32  `json:"durationInSeconds"`
	Expiry                 string `json:"expiry"`
	RemainingTimeInSeconds int32  `json:"remainingTimeInSeconds"`
}

ZoneStateOpenWindow holds the information about an open window of a zone state

type ZoneStateSensorDataPoints

type ZoneStateSensorDataPoints struct {
	InsideTemperature *TemperatureMeasurement `json:"insideTemperature"`
	Humidity          *PercentageMeasurement  `json:"humidity"`
}

ZoneStateSensorDataPoints holds sensor data points for a zone

type ZoneType

type ZoneType string

ZoneType defines the type of a zone

Directories

Path Synopsis
examples
me
internal
oauth2
Package oauth2 is a generated GoMock package.
Package oauth2 is a generated GoMock package.

Jump to

Keyboard shortcuts

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