weather

package
v0.0.0-...-89b2a28 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 11 Imported by: 0

README

Weather OpenAPI

docker run --rm -v $PWD:/local openapitools/openapi-generator-cli generate -i /local/netatmo_weather_openapi.json -g go -o /local/out/go

Documentation

Index

Constants

View Source
const (
	// UnitWind is the unit used for the wind in API responses
	UnitWind = "kph"
	// UnitPressure is the unit used for pressure in API responses
	UnitPressure = "mbar"
	// UnitTemperature is the unit used for temperature in API responses
	UnitTemperature = "°C"
	// UnitCO2 is the unit used for the co2 concentration in API responses
	UnitCO2 = "ppm"
	// UnitHumidity is the unit used for humidity in API responses
	UnitHumidity = "%"
	// UnitNoise is the unit used for noise level in API responses
	UnitNoise = "dB"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnemometerBatteryStatus

type AnemometerBatteryStatus int

AnemometerBatteryStatus represents the battery status of the anemometer battery

const (
	// AnemometerBatteryMax represents the maximum level of the anemometer battery
	AnemometerBatteryMax AnemometerBatteryStatus = 6000
	// AnemometerBatteryFull represents the full level of the anemometer battery
	AnemometerBatteryFull AnemometerBatteryStatus = 5590
	// AnemometerBatteryHigh represents the high level of the anemometer battery
	AnemometerBatteryHigh AnemometerBatteryStatus = 5180
	// AnemometerBatteryMedium represents the medium level of the anemometer battery
	AnemometerBatteryMedium AnemometerBatteryStatus = 4770
	// AnemometerBatteryLow represents the low level of the anemometer battery
	AnemometerBatteryLow AnemometerBatteryStatus = 4360
)

func (AnemometerBatteryStatus) GoString

func (abs AnemometerBatteryStatus) GoString() string

GoString implements the https://golang.org/pkg/fmt/#GoStringer interface

func (AnemometerBatteryStatus) String

func (abs AnemometerBatteryStatus) String() string

String implements the https://golang.org/pkg/fmt/#Stringer interface

type Client

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

Client holds the logic to perform weather api calls

func New

func New(client netatmo.AuthenticatedClient) *Client

New returns a weather api capable client

func (*Client) GetPublicData

func (wc *Client) GetPublicData(ctx context.Context, params GetPublicDataParameters) (publicStations []PublicStationData, headers http.Header, rs netatmo.RequestStats, err error)

GetPublicData retrieves publicly shared weather data from Outdoor Modules within a predefined area. https://dev.netatmo.com/apidocumentation/weather#getpublicdata

func (*Client) GetStationData

func (wc *Client) GetStationData(ctx context.Context, params GetStationDataParameters) (data StationDataBody,
	headers http.Header, rs netatmo.RequestStats, err error)

GetStationData returns data from a user Weather Stations (measures and device specific data). https://dev.netatmo.com/apidocumentation/weather#getstationsdata

type DashboardDataWeatherStation

type DashboardDataWeatherStation struct {
	Time             time.Time ``                        // time when data was measured
	Temperature      float64   `json:"Temperature"`      // temperature (in °C)
	CO2              int       `json:"CO2"`              // CO2 level (in ppm)
	Humidity         int       `json:"Humidity"`         // humidity (in %)
	Noise            int       `json:"Noise"`            // noise level (in dB)
	Pressure         float64   `json:"Pressure"`         // surface pressure in mbar
	AbsolutePressure float64   `json:"AbsolutePressure"` // sea-level pressure in mbar
	TempMin          float64   `json:"min_temp"`         // minimum temperature measured
	TempMinDate      time.Time ``                        // date of minimum temperature measured
	TempMax          float64   `json:"max_temp"`         // maximum temperature measured
	TempMaxDate      time.Time ``                        // date of maximum temperature measured
	TempTrend        Trend     `json:"temp_trend"`       // trend for the last 12h (up, down, stable)
	PressureTrend    Trend     `json:"pressure_trend"`   // trend for the last 12h (up, down, stable)
}

DashboardDataWeatherstation Weather - Weather station, getstationdata

func (*DashboardDataWeatherStation) UnmarshalJSON

func (ddws *DashboardDataWeatherStation) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to create a proper payloade on the fly during JSON unmarshaling

type GetPublicDataParameters

type GetPublicDataParameters struct {
	NorthEastLatitude  float64 `url:"lat_ne"`                  // latitude of the north east corner of the requested area. -85 <= lat_ne <= 85 and lat_ne>lat_sw
	NorthEastLongitude float64 `url:"lon_ne"`                  // Longitude of the north east corner of the requested area. -180 <= lon_ne <= 180 and lon_ne>lon_sw
	SouthWestLatitude  float64 `url:"lat_sw"`                  // latitude of the south west corner of the requested area. -85 <= lat_sw <= 85
	SouthWestLongitude float64 `url:"lon_sw"`                  // Longitude of the south west corner of the requested area. -180 <= lon_sw <= 180
	RequiredData       string  `url:"required_data,omitempty"` // To filter stations based on relevant measurements you want (e.g. rain will only return stations with rain gauges). Default is no filter.
	Filter             bool    `url:"filter,omitempty"`        // True to exclude station with abnormal temperature measures.
}

GetPublicDataParameters represents the parameters for GetPublicData()

type GetStationDataParameters

type GetStationDataParameters struct {
	DeviceID     string `url:"device_id,omitempty"`     // Weather station mac address
	GetFavorites bool   `url:"get_favorites,omitempty"` // To retrieve user's favorite weather stations
}

GetStationDataParameters represents the parameters used in GetStationData()

type IndoorModuleDashboardData

type IndoorModuleDashboardData struct {
	Time        time.Time ``                   // date when data was measured
	Temperature float64   `json:"Temperature"` // temperature (in °C)
	CO2         int64     `json:"CO2"`         // CO2 level (in ppm)
	Humidity    int64     `json:"Humidity"`    // humidity (in %)
	MinTemp     float64   `json:"min_temp"`    // maximum temperature measured
	MaxTemp     float64   `json:"max_temp"`    // maximum temperature measured
	DateMinTemp time.Time ``                   // date of minimum temperature measured
	DateMaxTemp time.Time ``                   // date of maximum temperature measured
	TempTrend   Trend     `json:"temp_trend"`  // trend for the last 12h (up, down, stable: see Trend const values)
}

IndoorModuleDashboardData struct for IndoorModuleDashboardData

func (*IndoorModuleDashboardData) UnmarshalJSON

func (imdd *IndoorModuleDashboardData) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to automatically convert data to go types

type Module

type Module struct {
	ID                   string                      `json:"_id"`             // uniq ID of the module (MAC address)
	Type                 ModuleType                  `json:"type"`            // type of module (see ModuleType const values)
	ModuleName           string                      `json:"module_name"`     // user set name of the module
	DataType             []ModuleDataType            `json:"data_type"`       // array of data measured by the device (see ModuleDataType const values)
	LastSetup            time.Time                   ``                       // date of the last installation
	Reachable            bool                        `json:"reachable"`       // true if the station connected to Netatmo cloud within the last 4 hours
	Firmware             int64                       `json:"firmware"`        // version of the software
	LastMessage          time.Time                   ``                       // date of the last measure update
	LastSeen             time.Time                   ``                       // date of the last status update
	RfStatus             RadioQuality                `json:"rf_status"`       // current radio status per module (see RadioQuality const values)
	BatteryVp            int64                       `json:"battery_vp"`      // current battery status per module (legacy, see BatteryPercent)
	BatteryPercent       int64                       `json:"battery_percent"` // percentage of battery remaining (10=low)
	DashboardDataOutdoor *OutdoorModuleDashboardData ``                       // values summary if module type is outdoor and is reachable
	DashboardDataWind    *WindModuleDashboardData    ``                       // values summary if module type is wind and is reachable
	DashboardDataRain    *RainModuleDashboardData    ``                       // values summary if module type is rain and is reachable
	DashboardDataIndoor  *IndoorModuleDashboardData  ``                       // values summary if module type is indoor and is reachable
	DashboardDataRaw     json.RawMessage             ``                       // in case type auto detect has failed, raw dashboard will be kept here (module must still be reachable)
}

Module contains information about any additionnal modules

func (*Module) UnmarshalJSON

func (m *Module) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to automatically convert data to go types

type ModuleDataType

type ModuleDataType string

ModuleDataType represents a given data type for a module

const (
	// ModuleDataTypeTemperature represents a temperature data type
	ModuleDataTypeTemperature ModuleDataType = "Temperature"
	// ModuleDataTypeCO2 represents a co2 type
	ModuleDataTypeCO2 ModuleDataType = "CO2"
	// ModuleDataTypeHumidity represents a humidity data type
	ModuleDataTypeHumidity ModuleDataType = "Humidity"
	// ModuleDataTypeNoise represents a noise data type
	ModuleDataTypeNoise ModuleDataType = "Noise"
	// ModuleDataTypePressure represents a pressure data type
	ModuleDataTypePressure ModuleDataType = "Pressure"
	// ModuleDataTypeWind represents a wind data type
	ModuleDataTypeWind ModuleDataType = "Wind"
	// ModuleDataTypeRain represents a rain data type
	ModuleDataTypeRain ModuleDataType = "Rain"
)

type ModuleType

type ModuleType string

ModuleType represents the type of an additionnal module

const (
	// ModuleTypeStation represents the main status
	ModuleTypeStation ModuleType = "NAMain"
	// ModuleTypeOutdoor represents the outdoor module
	ModuleTypeOutdoor ModuleType = "NAModule1"
	// ModuleTypeAnemometer represents the anemometer module
	ModuleTypeAnemometer ModuleType = "NAModule2"
	// ModuleTypeRainGauge represents the rain gauge module
	ModuleTypeRainGauge ModuleType = "NAModule3"
	// ModuleTypeIndoor represents an indoor module
	ModuleTypeIndoor ModuleType = "NAModule4"
)

type ModulesBatteryStatus

type ModulesBatteryStatus int

ModulesBatteryStatus represents the battery status for additionnal modules

const (
	// ModulesBatteryMax represents the maximum level of a module battery
	ModulesBatteryMax ModulesBatteryStatus = 6000
	// ModulesBatteryFull represents the full level of a module battery
	ModulesBatteryFull ModulesBatteryStatus = 5500
	// ModulesBatteryHigh represents the high level of a module battery
	ModulesBatteryHigh ModulesBatteryStatus = 5000
	// ModulesBatteryMedium represents the high level of a module battery
	ModulesBatteryMedium ModulesBatteryStatus = 4550
	// ModulesBatteryLow represents the low level of a module battery
	ModulesBatteryLow ModulesBatteryStatus = 4000
)

func (ModulesBatteryStatus) GoString

func (abs ModulesBatteryStatus) GoString() string

GoString implements the https://golang.org/pkg/fmt/#GoStringer interface

func (ModulesBatteryStatus) String

func (abs ModulesBatteryStatus) String() string

String implements the https://golang.org/pkg/fmt/#Stringer interface

type OutdoorModuleDashboardData

type OutdoorModuleDashboardData struct {
	Time        time.Time ``                   // date when data was measured
	Temperature float64   `json:"Temperature"` // temperature (in °C)
	Humidity    int64     `json:"Humidity"`    // humidity (in %)
	MinTemp     float64   `json:"min_temp"`    // minimum temperature measured
	MaxTemp     float64   `json:"max_temp"`    // maximum temperature measured
	DateMinTemp time.Time ``                   // date of minimum temperature measured
	DateMaxTemp time.Time ``                   // date of maximum temperature measured
	TempTrend   Trend     `json:"temp_trend"`  // trend for the last 12h (up, down, stable: see Trend const values)
}

OutdoorModuleDashboardData struct for OutdoorModuleDashboardData

func (*OutdoorModuleDashboardData) UnmarshalJSON

func (omdd *OutdoorModuleDashboardData) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to automatically convert data to go types

type Place

type Place struct {
	Timezone *time.Location ``                // Timezone
	Country  string         `json:"country"`  // Country
	Altitude float64        `json:"altitude"` // Altitude
	Location []float64      `json:"location"` // Lat, Long
}

Place struct for Place

func (*Place) UnmarshalJSON

func (p *Place) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to automatically convert data to go types

type PublicOutdoorModule

type PublicOutdoorModule struct {
	ID       string
	Measures PublicStationDataOutdoorValues
}

PublicOutdoorModule contains all the public informations for an outdoor module

type PublicRainModule

type PublicRainModule struct {
	ID       string
	Measures RainMeasures
}

PublicRainModule contains all the public informations for an rain gauge module

type PublicStationData

type PublicStationData struct {
	ID       string                          `json:"_id"`
	Place    Place                           `json:"place"`
	Mark     int                             `json:"mark"`
	Pressure PublicStationDataPressureValues ``
	Outdoor  *PublicOutdoorModule            ``
	Wind     *PublicWindModule               ``
	Rain     *PublicRainModule               ``
}

PublicStationData represents the public data of a station

func (*PublicStationData) UnmarshalJSON

func (pdb *PublicStationData) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to create a proper payloade on the fly during JSON unmarshaling

type PublicStationDataOutdoor

type PublicStationDataOutdoor struct {
	Time        time.Time
	Temperature float64
	Humidity    int
}

PublicStationDataOutdoor represents a given outdoor temperature and humidity measures at a given time

type PublicStationDataOutdoorValues

type PublicStationDataOutdoorValues []PublicStationDataOutdoor

PublicStationDataOutdoorValues is a collection of PublicStationDataOutdoor

func (PublicStationDataOutdoorValues) Len

func (psdov PublicStationDataOutdoorValues) Len() int

Len returns the number of values (implements the https://pkg.go.dev/sort#Interface)

func (PublicStationDataOutdoorValues) Less

func (psdov PublicStationDataOutdoorValues) Less(i, j int) bool

Less returns true if the timestamp of i is before j (implements the https://pkg.go.dev/sort#Interface)

func (PublicStationDataOutdoorValues) Swap

func (psdov PublicStationDataOutdoorValues) Swap(i, j int)

Swap changes the values places between them within the array (implements the https://pkg.go.dev/sort#Interface)

type PublicStationDataPressure

type PublicStationDataPressure struct {
	Time     time.Time
	Pressure float64
}

PublicStationDataPressure represents a given presure at a given time

type PublicStationDataPressureValues

type PublicStationDataPressureValues []PublicStationDataPressure

PublicStationDataPressureValues is a collection of PublicStationDataPressure

func (PublicStationDataPressureValues) Len

Len returns the number of values (implements the https://pkg.go.dev/sort#Interface)

func (PublicStationDataPressureValues) Less

func (psdpv PublicStationDataPressureValues) Less(i, j int) bool

Less returns true if the timestamp of i is before j (implements the https://pkg.go.dev/sort#Interface)

func (PublicStationDataPressureValues) Swap

func (psdpv PublicStationDataPressureValues) Swap(i, j int)

Swap changes the values places between them within the array (implements the https://pkg.go.dev/sort#Interface)

type PublicWindModule

type PublicWindModule struct {
	ID       string
	Measures WindMeasures
}

PublicWindModule contains all the public informations for an anemometer module

type RadioQuality

type RadioQuality int

RadioQuality represents the radio signal quality between a station and its modules

const (
	// RadioQualityLow represents a low quality radio link
	RadioQualityLow RadioQuality = 90
	// RadioQualityMedium represents a medium quality radio link
	RadioQualityMedium RadioQuality = 80 // custom
	// RadioQualityHigh represents a high quality radio link
	RadioQualityHigh RadioQuality = 70 // custom
	// RadioQUalityHighest represents the highest quality radio link
	RadioQUalityHighest RadioQuality = 60
)

func (RadioQuality) GoString

func (rq RadioQuality) GoString() string

GoString implements the https://golang.org/pkg/fmt/#GoStringer interface

func (RadioQuality) String

func (rq RadioQuality) String() string

String implements the https://golang.org/pkg/fmt/#Stringer interface

type RainMeasures

type RainMeasures struct {
	Time      time.Time `` // not in this form on the orignal payload
	Rain60min float64   `json:"rain_60min"`
	Rain24h   float64   `json:"rain_24h"`
	RainLive  float64   `json:"rain_live"`
}

RainMeasures holds measures for the RainGauge module

func (*RainMeasures) UnmarshalJSON

func (rm *RainMeasures) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to create a proper payloade on the fly during JSON unmarshaling

type RainModuleDashboardData

type RainModuleDashboardData struct {
	Time      time.Time ``                   // date when data was measured
	Rain      float64   `json:"Rain"`        // rain in mm
	SumRain24 float64   `json:"sum_rain_24"` // rain measured for past 24h(mm)
	SumRain1  float64   `json:"sum_rain_1"`  // rain measured for the last hour (mm)
}

RainModuleDashboardData struct for RainModuleDashboardData

func (*RainModuleDashboardData) UnmarshalJSON

func (rmdd *RainModuleDashboardData) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to automatically convert data to go types

type StationDataBody

type StationDataBody struct {
	Devices []StationDataBodyDevices `json:"devices"`
	User    UserWeather              `json:"user"`
}

StationDataBody struct for StationDataBody

type StationDataBodyDevices

type StationDataBodyDevices struct {
	ID              string                      `json:"_id"`             // uniq ID of the module (MAC address)
	DateSetup       time.Time                   ``                       // date when the weather station was set up
	LastSetup       time.Time                   ``                       // timestamp of the last installation
	LastStatusStore time.Time                   ``                       // timestamp of the last status update
	LastUpgrade     time.Time                   ``                       // timestamp of the last upgrade
	Type            ModuleType                  `json:"type"`            // type of the device (should alway be ModuleTypeStation const value)
	ModuleName      string                      `json:"module_name"`     // name of the module
	Firmware        int                         `json:"firmware"`        // version of the software
	WifiStatus      WiFiQuality                 `json:"wifi_status"`     // wifi status per Base station. (86=bad, 56=good)
	Reachable       bool                        `json:"reachable"`       // true if the station connected to Netatmo cloud within the last 4 hours
	CO2Calibrating  bool                        `json:"co2_calibrating"` // true if the station is calibrating
	DataType        []ModuleDataType            `json:"data_type"`       // array of data measured by the device (see ModuleDataType const values)
	Place           Place                       `json:"place"`           // informations about where the station is
	ReadOnly        bool                        `json:"read_only"`       // true if the user owns the station, false if he is invited to a station
	HomeId          string                      `json:"home_id"`         // id of the home where the station is placed
	HomeName        string                      `json:"home_name"`       // name of the home where the station is placed
	DashboardData   DashboardDataWeatherStation `json:"dashboard_data"`  // values summary
	Modules         []Module                    `json:"modules"`
}

StationDataBodyDevices struct for StationDataBodyDevices

func (*StationDataBodyDevices) UnmarshalJSON

func (sdbd *StationDataBodyDevices) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to create a proper payloade on the fly during JSON unmarshaling

type Trend

type Trend string

Trend represents a current trend

const (
	// TrendUp represents a trend going up
	TrendUp Trend = "up"
	// TrendDown represents a trend going down
	TrendDown Trend = "down"
	// TrendStable represents a stable trend
	TrendStable Trend = "stable"
)

type UserUnitFeelLike

type UserUnitFeelLike int

UserUnitFeelLike represents the unit the user choose for display for feel like temperature

const (
	// UserUnitFeelLikeHumidex represent the Humidex feel like unit
	UserUnitFeelLikeHumidex UserUnitFeelLike = 0
	// UserUnitFeelLikeHeatIndex represent the Heat Index feel like unit
	UserUnitFeelLikeHeatIndex UserUnitFeelLike = 1
)

func (UserUnitFeelLike) GoString

func (uufl UserUnitFeelLike) GoString() string

GoString implements the https://golang.org/pkg/fmt/#GoStringer interface

func (UserUnitFeelLike) String

func (uufl UserUnitFeelLike) String() string

String implements the https://golang.org/pkg/fmt/#Stringer interface

type UserUnitPressure

type UserUnitPressure int

UserUnitPressure represents the unit a user has chosen for display

const (
	// UserUnitPressureMbar represents the Mbar unit display user preference
	UserUnitPressureMbar UserUnitPressure = 0
	// UserUnitPressureInHg represents the InHg unit display user preference
	UserUnitPressureInHg UserUnitPressure = 1
	// UserUnitPressureMmHg represents the MmHg unit display user preference
	UserUnitPressureMmHg UserUnitPressure = 2
)

func (UserUnitPressure) GoString

func (uup UserUnitPressure) GoString() string

GoString implements the https://golang.org/pkg/fmt/#GoStringer interface

func (UserUnitPressure) String

func (uup UserUnitPressure) String() string

String implements the https://golang.org/pkg/fmt/#Stringer interface

type UserUnitSystem

type UserUnitSystem int

UserUnitSystem represents the unit system the user is using

const (
	// UserUnitSystemMetric represents the international Metric system
	UserUnitSystemMetric UserUnitSystem = 0
	// UserUnitSystemImperial represents the Imperial metric
	UserUnitSystemImperial UserUnitSystem = 1
)

func (UserUnitSystem) GoString

func (uus UserUnitSystem) GoString() string

GoString implements the https://golang.org/pkg/fmt/#GoStringer interface

func (UserUnitSystem) String

func (uus UserUnitSystem) String() string

String implements the https://golang.org/pkg/fmt/#Stringer interface

type UserUnitWind

type UserUnitWind int

UserUnitWind represents the unit chosen by the user to represents the wind speed

const (
	// UserUnitWindKph represents the Kilometer per Hour unit
	UserUnitWindKph UserUnitWind = 0
	// UserUnitWindMph represents the Miles per Hour unit
	UserUnitWindMph UserUnitWind = 1
	// UserUnitWindMs represents the Meter per Hour unit
	UserUnitWindMs UserUnitWind = 2
	// UserUnitWindBeaufort represents the Beaufort unit
	UserUnitWindBeaufort UserUnitWind = 3
	// UserUnitWindKnot represents the Knot unit
	UserUnitWindKnot UserUnitWind = 4
)

func (UserUnitWind) GoString

func (uuw UserUnitWind) GoString() string

GoString implements the https://golang.org/pkg/fmt/#GoStringer interface

func (UserUnitWind) String

func (uuw UserUnitWind) String() string

String implements the https://golang.org/pkg/fmt/#Stringer interface

type UserWeather

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

UserWeather struct for UserWeather

type UserWeatherAdministrative

type UserWeatherAdministrative struct {
	RegLocale    string           `json:"reg_locale"`     // user regional preferences (used for displaying date)
	Lang         string           `json:"lang"`           // user locale
	Country      string           `json:"country"`        // country
	Unit         UserUnitSystem   `json:"unit"`           // metric system, imperial system
	Windunit     UserUnitWind     `json:"windunit"`       // kph, mph, ms, beaufort, knot
	Pressureunit UserUnitPressure `json:"pressureunit"`   // mbar, inHg, mmHg
	FeelLikeAlgo UserUnitFeelLike `json:"feel_like_algo"` // algorithm used to compute feel like temperature: humidex, heat-index
}

UserWeatherAdministrative struct for UserWeatherAdministrative

type WiFiQuality

type WiFiQuality int

WiFiQuality represents the WiFi strength signal

const (
	// WiFiQualityBad represents a bad level for WiFi reception
	WiFiQualityBad WiFiQuality = 86
	// WiFiQualityAverage represents an average level for WiFi reception
	WiFiQualityAverage WiFiQuality = 71
	// WiFiQUalityGood represents a good level for WiFi reception
	WiFiQUalityGood WiFiQuality = 56
)

func (WiFiQuality) GoString

func (wq WiFiQuality) GoString() string

GoString implements the https://golang.org/pkg/fmt/#GoStringer interface

func (WiFiQuality) String

func (wq WiFiQuality) String() string

String implements the https://golang.org/pkg/fmt/#Stringer interface

type WindMeasures

type WindMeasures struct {
	Time         time.Time ``                    // not in this form on the orignal payload
	WindStrength int       `json:"wind_strengh"` // yes the API has a typo on JSON key
	WindAngle    int       `json:"wind_angle"`
	GustStrength int       `json:"gust_strenght"` // yes the API has a typo on JSON key
	GustAngle    int       `json:"gust_angle"`
}

WindMeasures holds measures for the anemometer module

func (*WindMeasures) UnmarshalJSON

func (wm *WindMeasures) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to create a proper payloade on the fly during JSON unmarshaling

type WindModuleDashboardData

type WindModuleDashboardData struct {
	Time           time.Time ``                      // date when data was measured
	WindStrength   int       `json:"WindStrength"`   // wind strength (km/h)
	WindAngle      int       `json:"WindAngle"`      // wind angle
	GustStrength   int       `json:"GustStrength"`   // gust strength (km/h)
	GustAngle      int       `json:"GustAngle"`      // gust angle
	MaxWindStr     int       `json:"max_wind_str"`   // max wind strength (km/h)
	MaxWindAngle   int       `json:"max_wind_angle"` // max wind angle
	DateMaxWindStr time.Time ``                      // max wind date
}

WindModuleDashboardData struct for WindModuleDashboardData

func (*WindModuleDashboardData) UnmarshalJSON

func (wmdd *WindModuleDashboardData) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON allows to automatically convert data to go types

Jump to

Keyboard shortcuts

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