netatmo

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DevicesAction action for listing devices
	DevicesAction = "devices"

	// Source constant for worker message
	Source = "netatmo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AccessToken  string
	RefreshToken string
	ClientID     string
	ClientSecret string
	Scopes       string
}

func Flags

func Flags(fs *flag.FlagSet, prefix string) *Config

type DashboardData

type DashboardData struct {
	Temperature float64 `json:"Temperature"`
	Humidity    float64 `json:"Humidity"`
	Noise       float64 `json:"Noise"`
	CO2         float64 `json:"CO2"`
	Pressure    float64 `json:"Pressure"`
}

DashboardData contains dashboard data

type Device

type Device struct {
	StationName string `json:"station_name"`
	ModuleName  string `json:"module_name"`
	Modules     []struct {
		ModuleName    string        `json:"module_name"`
		BatterPercent int           `json:"battery_percent"`
		DashboardData DashboardData `json:"dashboard_data"`
	} `json:"modules"`
	DashboardData DashboardData `json:"dashboard_data"`
}

Device contains a device data

type Error

type Error struct {
	Error struct {
		Message string
		Code    int
	}
}

Error describes error

type Service added in v1.6.0

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

func New

func New(config *Config, meterProvider metric.MeterProvider) (*Service, error)

func (*Service) Enabled added in v1.6.0

func (s *Service) Enabled() bool

func (*Service) HasScope added in v1.6.0

func (s *Service) HasScope(scope string) bool

func (*Service) Start added in v1.6.0

func (s *Service) Start(ctx context.Context)

type StationsData

type StationsData struct {
	Body struct {
		Devices []Device `json:"devices"`
	} `json:"body"`
}

StationsData contains data retrieved when getting stations datas

type Token

type Token struct {
	AccessToken string `json:"access_token"`
}

Token describes refresh token response

Jump to

Keyboard shortcuts

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