weather_met

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name ...
	Name = "weather_met"
	// DefaultApiUrl ...
	DefaultApiUrl = "https://api.met.no/weatherapi/locationforecast/2.0/classic"
)
View Source
const (
	// Attribution ...
	Attribution = "Weather forecast from met.no, delivered by the Norwegian Meteorological Institute."
)

Variables

This section is empty.

Functions

func New

func New() plugins.Plugable

New ...

Types

type Cloudiness

type Cloudiness struct {
	Id      string `xml:"id,attr"`
	Percent string `xml:"percent,attr"`
}

Cloudiness ...

type DewpointTemperature

type DewpointTemperature struct {
	Id    string `xml:"id,attr"`
	Unit  string `xml:"unit,attr"`
	Value string `xml:"value,attr"`
}

DewpointTemperature ...

type Fog

type Fog struct {
	Id      string `xml:"id,attr"`
	Percent string `xml:"percent,attr"`
}

Fog ...

type HighClouds

type HighClouds struct {
	Id      string `xml:"id,attr"`
	Percent string `xml:"percent,attr"`
}

HighClouds ...

type Humidity

type Humidity struct {
	Unit  string `xml:"unit,attr"`
	Value string `xml:"value,attr"`
}

Humidity ...

type Location

type Location struct {
	Altitude            string               `xml:"altitude,attr"`
	Latitude            string               `xml:"latitude,attr"`
	Longitude           string               `xml:"longitude,attr"`
	Temperature         *Temperature         `xml:"temperature,omitempty" json:"temperature,omitempty"`
	WindDirection       *WindDirection       `xml:"windDirection,omitempty" json:"windDirection,omitempty"`
	WindSpeed           *WindSpeed           `xml:"windSpeed,omitempty" json:"windSpeed,omitempty"`
	Humidity            *Humidity            `xml:"humidity,omitempty" json:"humidity,omitempty"`
	Pressure            *Pressure            `xml:"pressure,omitempty" json:"pressure,omitempty"`
	Cloudiness          *Cloudiness          `xml:"cloudiness,omitempty" json:"cloudiness,omitempty"`
	Fog                 *Fog                 `xml:"fog,omitempty" json:"fog,omitempty"`
	LowClouds           *LowClouds           `xml:"lowClouds,omitempty" json:"lowClouds,omitempty"`
	MediumClouds        *MediumClouds        `xml:"mediumClouds,omitempty" json:"mediumClouds,omitempty"`
	HighClouds          *HighClouds          `xml:"highClouds,omitempty" json:"highClouds,omitempty"`
	DewpointTemperature *DewpointTemperature `xml:"dewpointTemperature,omitempty" json:"dewpointTemperature,omitempty"`
	Precipitation       *Precipitation       `xml:"precipitation,omitempty" json:"precipitation,omitempty"`
	Symbol              *Symbol              `xml:"symbol,omitempty" json:"symbol,omitempty"`
	MinTemperature      *MinTemperature      `xml:"minTemperature,omitempty" json:"minTemperature,omitempty"`
	MaxTemperature      *MaxTemperature      `xml:"maxTemperature,omitempty" json:"maxTemperature,omitempty"`
}

Location ...

type LowClouds

type LowClouds struct {
	Id      string `xml:"id,attr"`
	Percent string `xml:"percent,attr"`
}

LowClouds ...

type MaxTemperature

type MaxTemperature struct {
	Id    string `xml:"id,attr"`
	Unit  string `xml:"unit,attr"`
	Value string `xml:"value,attr"`
}

MaxTemperature ...

type MediumClouds

type MediumClouds struct {
	Id      string `xml:"id,attr"`
	Percent string `xml:"percent,attr"`
}

MediumClouds ...

type MinTemperature

type MinTemperature struct {
	Id    string `xml:"id,attr"`
	Unit  string `xml:"unit,attr"`
	Value string `xml:"value,attr"`
}

MinTemperature ...

type Precipitation

type Precipitation struct {
	Unit  string `xml:"unit,attr"`
	Value string `xml:"value,attr"`
}

Precipitation ...

type Pressure

type Pressure struct {
	Id    string `xml:"id,attr"`
	Unit  string `xml:"unit,attr"`
	Value string `xml:"value,attr"`
}

Pressure ...

type Product

type Product struct {
	Datatype string    `xml:"datatype,attr"`
	From     time.Time `xml:"from,attr"`
	To       time.Time `xml:"to,attr"`
	Location Location  `xml:"location"`
}

Product ...

type Products

type Products []Product

Products ...

func (Products) Len

func (p Products) Len() int

Len ...

func (Products) Less

func (p Products) Less(a, b int) bool

Less ...

func (Products) Swap

func (p Products) Swap(a, b int)

Swap ...

type Symbol

type Symbol struct {
	Id     string `xml:"id,attr"`
	Number string `xml:"number,attr"`
}

Symbol ...

type Temperature

type Temperature struct {
	Id    string `xml:"id,attr"`
	Unit  string `xml:"unit,attr"`
	Value string `xml:"value,attr"`
}

Temperature ...

type WeatherMet

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

WeatherMet ...

func NewWeatherMet

func NewWeatherMet(eventBus event_bus.EventBus,
	adaptors *adaptors.Adaptors) (weather *WeatherMet)

NewWeatherMet ...

func (*WeatherMet) AddWeather

func (p *WeatherMet) AddWeather(entityId common.EntityId, settings m.Attributes)

AddWeather ...

func (*WeatherMet) FetchData

func (p *WeatherMet) FetchData(name string, lat, lon float64, now time.Time) (zone Zone, err error)

FetchData ...

func (*WeatherMet) GetForecast

func (p *WeatherMet) GetForecast(params Zone, now time.Time) (forecast m.AttributeValue, err error)

GetForecast ...

func (*WeatherMet) RemoveWeather

func (p *WeatherMet) RemoveWeather(entityId common.EntityId)

RemoveWeather ...

func (*WeatherMet) UpdateForecast

func (p *WeatherMet) UpdateForecast(zone Zone) (err error)

UpdateForecast ...

func (*WeatherMet) UpdateForecastForAll

func (p *WeatherMet) UpdateForecastForAll() (err error)

UpdateForecastForAll ...

func (*WeatherMet) UpdateWeatherList

func (p *WeatherMet) UpdateWeatherList(entityId common.EntityId, settings m.Attributes)

UpdateWeatherList ...

type Weatherdata

type Weatherdata struct {
	XMLName  xml.Name `xml:"weatherdata"`
	Products Products `xml:"product>time"`
}

Weatherdata ...

type WindDirection

type WindDirection struct {
	Id   string `xml:"id,attr"`
	Deg  string `xml:"deg,attr"`
	Name string `xml:"name,attr"`
}

WindDirection ...

type WindSpeed

type WindSpeed struct {
	Id       string `xml:"id,attr"`
	Mps      string `xml:"mps,attr"`
	Beaufort string `xml:"beaufort,attr"`
	Name     string `xml:"name,attr"`
}

WindSpeed ...

type Zone

type Zone struct {
	Name        string       `json:"name"`
	Lat         float64      `json:"lat"`
	Lon         float64      `json:"lon"`
	Weatherdata *Weatherdata `json:"weatherdata"`
	LoadedAt    *time.Time   `json:"loaded_at"`
}

Zone ...

Jump to

Keyboard shortcuts

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