weather_met

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

README

WEATHER MET Plugin

Documentation

Documentation

Index

Constants

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

	Version = "0.0.1"
)

Variables

Functions

func New

func New() supervisor.Pluggable

New ...

Types

type Actor added in v0.9.0

type Actor struct {
	*supervisor.BaseActor
	Zone
	// contains filtered or unexported fields
}

Actor ...

func NewActor added in v0.9.0

func NewActor(entity *m.Entity,
	service supervisor.Service) *Actor

NewActor ...

func (*Actor) Destroy added in v0.12.0

func (e *Actor) Destroy()

func (*Actor) SetState added in v0.9.0

func (e *Actor) SetState(params supervisor.EntityStateParams) error

SetState ...

func (*Actor) Spawn added in v0.9.0

func (e *Actor) Spawn()

Spawn ...

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(adaptors *adaptors.Adaptors, crawler web.Crawler) (weather *WeatherMet)

NewWeatherMet ...

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) UpdateForecast

func (p *WeatherMet) UpdateForecast(zone Zone) (forecast m.AttributeValue, err error)

UpdateForecast ...

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