netatmo_api

package
v0.0.0-...-312f9aa Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadThermostat = "read_thermostat"
	ReadStation    = "read_station"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client working with netatmo API

func NewClient

func NewClient(ctx context.Context, cnf *Config) (*Client, error)

NewClient creates a new authenticated client

func (*Client) GetHomeStatus

func (c *Client) GetHomeStatus(home string) (*HomeStatus, error)

func (*Client) GetHomes

func (c *Client) GetHomes() (*Homes, error)

func (*Client) GetHomesData

func (c *Client) GetHomesData() (*HomesData, error)

func (*Client) GetMeasure

func (c *Client) GetMeasure(m *Module, from time.Time, until time.Time) (*ModuleMeasures, error)

type Config

type Config struct {
	Username     string
	Password     string
	RefreshToken string
	ClientID     string
	ClientSecret string
	Scopes       []string
}

Config contains configuration for OAuth2

type Home

type Home struct {
	Altitude    uint32    `json:"altitude"`
	Country     string    `json:"country"`
	Id          string    `json:"id"`
	Name        string    `json:"name"`
	Coordinates []float64 `json:"coordinates"`
	Modules     []*Module `json:"modules"`
	Rooms       []*Room   `json:"rooms"`
}

func (*Home) Merge

func (h *Home) Merge(h2 *Home)

type HomeStatus

type HomeStatus struct {
	Home *Home `json:"home"`
}

type Homes

type Homes struct {
	Homes []*Home `json:"homes"`
}

type HomesData

type HomesData struct {
	Homes []*Home `json:"homes"`
}

type Module

type Module struct {
	Id               string  `json:"id"`
	Reachable        bool    `json:"reachable"`
	Type             string  `json:"type"`
	Bridge           string  `json:"bridge"`
	Anticipating     bool    `json:"anticipating"`
	FirmwareRevision float64 `json:"firmware_revision"`
	RfStrength       float64 `json:"rf_strength"`
	WifiStrength     float64 `json:"wifi_strength"`
	BatteryLevel     float64 `json:"battery_level"`
	BatteryState     string  `json:"battery_state"`
	BoilerStatus     bool    `json:"boiler_status"`
	RoomId           string  `json:"room_id"`
}

func (*Module) Merge

func (m *Module) Merge(m2 *Module)

type ModuleMeasurePoint

type ModuleMeasurePoint struct {
	Time                int64   `json:"time"`
	SumBoilerOn         uint16  `json:"sum_boiler_on"`
	SumBoilerOff        uint16  `json:"sum_boiler_off"`
	MeasuredTemperature float64 `json:"therm_measured_temperature"`
	SetPointTemperature float64 `json:"therm_setpoint_temperature"`
}

type ModuleMeasures

type ModuleMeasures struct {
	Measures []*ModuleMeasurePoint `json:"measures"`
}

type Room

type Room struct {
	Reachable           bool    `json:"reachable"`
	Id                  string  `json:"id"`
	Name                string  `json:"name"`
	Anticipating        bool    `json:"anticipating"`
	OpenWindow          bool    `json:"open_window"`
	MeasuredTemperature float64 `json:"therm_measured_temperature"`
	SetPointTemperature float64 `json:"therm_setpoint_temperature"`
	SetPointStartTime   uint64  `json:"therm_setpoint_start_time"`
	SetPointEndTime     uint64  `json:"therm_setpoint_end_time"`
	SetPointMode        string  `json:"therm_setpoint_mode"`
}

func (*Room) Merge

func (r *Room) Merge(r2 *Room)

Jump to

Keyboard shortcuts

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