Skip to content

isokar/gladys-forecast

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gladys-forecast

Gladys weather provider for the forecast API.

Need Gladys >= 3.4

Installation

  • Create a Forecast account here => https://darksky.net/dev/
  • Install the module in Gladys
  • Reboot Gladys
  • In Gladys dashboard, in "Parameters" => "Parameters" :
    • Update param "FORECAST_API_KEY" with the API key provided by darksky.

Usage

Basic

var options = {
    latitude: 45,
    longitude: 45
};

gladys.weather.get(options)
    .then((result) => {
        console.log(result);
        console.log(result.temperature);
        console.log(result.weather);
        console.log(result.humidity);
    })
    .catch(console.log);

Offset

If you want the weather in 2 hours, simply call :

var options = {
    latitude: 45,
    longitude: 45,
    offset: 2 // in hour
};

gladys.weather.get(options)
    .then((result) => {
        console.log(result);
        console.log(result.temperature);
        console.log(result.weather);
        console.log(result.humidity);
    })
    .catch(console.log);

If you wants in 2 days, put offset: 48

It works up to 7 days.

About

Gladys weather provider with Forecast API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%