homecoach

package
v0.0.0-...-e64aa6a Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Administrative

type Administrative struct {
	Country      string `json:"country"`
	FeelLikeAlgo int    `json:"feel_like_algo"`
	Lang         string `json:"lang"`
	Pressureunit int    `json:"pressureunit"`
	RegLocale    string `json:"reg_locale"`
	Unit         int    `json:"unit"`
	Windunit     int    `json:"windunit"`
}

Administrative infor about device owner

type Body

type Body struct {
	Devices []Device `json:"devices"`
	User    User     `json:"user"`
}

Body part of response including devices

type Client

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

Client use to make request to Netatmo API

func NewClient

func NewClient(config Config) (*Client, error)

NewClient create a handle authentication to Netamo API

func (*Client) Read

func (c *Client) Read() (*Response, error)

GetStations returns the list of stations owned by the user, and their modules

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	Username     string
	Password     string
}

Config is used to specify credential to Netatmo API ClientID : Client ID from netatmo app registration at http://dev.netatmo.com/dev/listapps ClientSecret : Client app secret Username : Your netatmo account username Password : Your netatmo account password

type DashboardData

type DashboardData struct {
	AbsolutePressure float32 `json:"AbsolutePressure"`
	TimeUTC          int64   `json:"time_utc"`
	HealthIndex      int     `json:"health_idx"`
	Noise            int     `json:"Noise"`
	Temperature      float32 `json:"Temperature"`
	TempTrend        string  `json:"temp_trend"`
	Humidity         float32 `json:"Humidity"`
	Pressure         float32 `json:"Pressure"`
	PressureTrend    string  `json:"pressure_trend"`
	CO2              float32 `json:"CO2"`
	DateMaxTemp      int64   `json:"date_max_temp"`
	DateMinTemp      int64   `json:"date_min_temp"`
	MinTemp          float32 `json:"min_temp"`
	MaxTemp          float32 `json:"max_temp"`
}

DashboardData contains the actual sensor data from a device

type Device

type Device struct {
	ID              string        `json:"_id"`
	CipherID        string        `json:"cipher_id"`
	LastStatusStore int64         `json:"last_status_store"`
	Place           Place         `json:"place"`
	Type            string        `json:"type"`
	DashboardData   DashboardData `json:"dashboard_data"`
	DataType        []string      `json:"data_type"`
	Co2Calibrating  bool          `json:"co2_calibrating"`
	DateSetup       int64         `json:"date_setup"`
	LastSetup       int64         `json:"last_setup"`
	ModuleName      string        `json:"module_name"`
	Firmware        int           `json:"firmware"`
	LastUpgrade     int64         `json:"last_upgrade"`
	WifiStatus      int           `json:"wifi_status"`
	Name            string        `json:"name"`
}

Device describes the returned Netatmo device including sensor data

type Mapping

type Mapping struct {
	ModuleID string   `json:"moduleId"`
	Name     string   `json:"name"`
	Server   string   `json:"server"`
	Streams  []Stream `json:"streams"`
}

Mapping contains information about the link between the netatmo stations, sensors and datastreams

type Module

type Module struct {
	module.ConnectorModuleBase
	// contains filtered or unexported fields
}

Module adds support for publishing Netatmo weather module readings to a SensorThings server.

func (*Module) Setup

func (m *Module) Setup() error

Setup initialised the module by setting some default values

func (*Module) Start

func (m *Module) Start(initStartup bool) error

Start receiving Netatmo readings and publish it to a SensorThings server

func (*Module) Stop

func (m *Module) Stop()

Stop receiving Netatmo readings

type Place

type Place struct {
	Altitude float64   `json:"altitude"`
	City     string    `json:"city"`
	Country  string    `json:"country"`
	Timezone string    `json:"timezone"`
	Location []float64 `json:"location"`
}

Place of module

type Response

type Response struct {
	Body       Body    `json:"body"`
	Status     string  `json:"status"`
	TimeExec   float64 `json:"time_exec"`
	TimeServer int64   `json:"time_server"`
}

Response from homecoach endpoint

type Settings

type Settings struct {
	ClientID      string    `json:"clientId"`
	ClientSecret  string    `json:"clientSecret"`
	Username      string    `json:"username"`
	Password      string    `json:"password"`
	FetchInterval int       `json:"fetchIntervalSeconds"`
	Mappings      []Mapping `json:"mappings"`
}

Settings contains information on Netatmo login and sensor reading to datastream mappings

type Stream

type Stream struct {
	Type     string `json:"type"`
	StreamID string `json:"streamId"`
}

Stream Netatmo type to SensorThings stream

type User

type User struct {
	Mail           string         `json:"mail"`
	Administrative Administrative `json:"administrative"`
}

User describes the device owner

Jump to

Keyboard shortcuts

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