weather_met

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: GPL-3.0 Imports: 24 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 (
	EntityWeather = "weather_met"
	// Attribution ...
	Attribution = "Weather forecast from met.no, delivered by the Norwegian Meteorological Institute."
	// FuncEntityAction ...
	FuncEntityAction = "entityAction"

	Version = "0.0.1"
)

Variables

This section is empty.

Functions

func New

func New() plugins.Plugable

New ...

Types

type Actor added in v0.9.0

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

Actor ...

func NewActor added in v0.9.0

func NewActor(entity *m.Entity,
	entityManager entity_manager.EntityManager,
	adaptors *adaptors.Adaptors,
	scriptService scripts.ScriptService,
	eventBus bus.Bus,
	crawler web.Crawler) *Actor

NewActor ...

func (*Actor) SetState added in v0.9.0

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

SetState ...

func (*Actor) Spawn added in v0.9.0

func (e *Actor) Spawn() entity_manager.PluginActor

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