weathercloud

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2018 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package weathercloud implements the Weathercloud device upload protocol.

Index

Constants

This section is empty.

Variables

View Source
var URL = "http://api.weathercloud.net/v01"

URL is the base API URL.

Functions

This section is empty.

Types

type Device

type Device struct {
	WID             string    // Device ID (assigned during creation)
	Key             string    // Device key (assigned during creation)
	SoftwareType    uint16    // Software type
	SoftwareVersion string    // Software version
	Time            time.Time // Upload time (default is now)
}

Device represents a weather device.

func (Device) Encode

func (d Device) Encode(obs ...query.Values) string

Encode returns the request URL for the specified observations. This is generally used for testing and debugging.

func (*Device) Upload

func (d *Device) Upload(obs ...query.Values) (err error)

Upload uploads the specified observations.

type Wx

type Wx struct {
	query.Data
}

Wx represents weather observations.

func (*Wx) Bar

func (w *Wx) Bar(in float64)

Bar is atmospheric pressure in inches.

func (*Wx) DailyET

func (w *Wx) DailyET(in float64)

DailyET is the evapotranspiration so far today (local time) in inches.

func (*Wx) DailyRain

func (w *Wx) DailyRain(in float64)

DailyRain is rain so far today (local time) in inches.

func (*Wx) DewPoint

func (w *Wx) DewPoint(f float64)

DewPoint is the outdoor dew point in degrees Fahrenheit.

func (*Wx) HeatIndex

func (w *Wx) HeatIndex(f float64)

HeatIndex is the outdoor heat index in degrees Fahrenheit.

func (*Wx) InHumidity

func (w *Wx) InHumidity(p int)

InHumidity is the indoor humidity percentage (0-100).

func (*Wx) InTemp

func (w *Wx) InTemp(f float64)

InTemp is the indoor temperature in degrees Fahrenheit.

func (*Wx) LeafWetness

func (w *Wx) LeafWetness(p int)

LeafWetness is the leaf wetness index.

func (*Wx) OutHumidity

func (w *Wx) OutHumidity(p int)

OutHumidity is the outdoor humidity percentage (0-100).

func (*Wx) OutTemp

func (w *Wx) OutTemp(f float64)

OutTemp is outdoor temperature in degrees Fahrenheit.

func (*Wx) RainRate

func (w *Wx) RainRate(in float64)

RainRate is rain over the past hour or the accumulated rainfall for the past 60 minutes in inches.

func (*Wx) SoilMoist

func (w *Wx) SoilMoist(cb int)

SoilMoist is the soil moisture in centibars of tension.

func (*Wx) SolarRad

func (w *Wx) SolarRad(wm2 int)

SolarRad is solar radiation in watts per square meter.

func (*Wx) UVIndex

func (w *Wx) UVIndex(i float64)

UVIndex is the UltraViolet light index.

func (*Wx) WindChill

func (w *Wx) WindChill(f float64)

WindChill is the wind chill in degrees Fahrenheit.

func (*Wx) WindDir

func (w *Wx) WindDir(deg int)

WindDir is instantaneous wind direction in degrees (0-359).

func (*Wx) WindDirAvg

func (w *Wx) WindDirAvg(deg int)

WindDirAvg is the 10 minute average wind direction in degrees (0-359).

func (*Wx) WindGustSpeed

func (w *Wx) WindGustSpeed(mph float64)

WindGustSpeed is the 10 minute wind gust speed in miles per hour.

func (*Wx) WindSpeed

func (w *Wx) WindSpeed(mph float64)

WindSpeed is the instantaneous wind speed in miles per hour.

func (*Wx) WindSpeedAvg

func (w *Wx) WindSpeedAvg(mph float64)

WindSpeedAvg is the 10 minute average wind speed in miles per hour.

Jump to

Keyboard shortcuts

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