dashbling-widget-weather

2.0.4 • Public • Published

Dashbling weather widget

This is a widget for Dashbling, displaying local Weather information.

Weather information is provided by OpenWeatherMap. This widget requires a (free) OpenWeatherMap API key. Register at https://openweathermap.org/appid.

Usage

Add to your project:

yarn add dashbling-widget-weather

Add a job to fetch weather data:

// dashbling.config.js
module.exports = {
    jobs: [
        {
            schedule: "*/30 * * * *",
            fn: require("dashbling-widget-weather/job")(
                "weather-amsterdam", // event id
                "YOUR OPENWEATHERMAP APPID HERE",
                "2759794" // city id
            )
        }
    ]
}

And add the widget to your dashboard:

import { WeatherWidget } from "dashbling-widget-weather";
const WeatherInAmsterdam = connect("weather-amsterdam")(WeatherWidget);
 
export default props => {
  return (
    <Dashboard>
      <WeatherInAmsterdam title="Amsterdam" />
    </Dashboard>
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i dashbling-widget-weather

Weekly Downloads

44

Version

2.0.4

License

MIT

Unpacked Size

314 kB

Total Files

25

Last publish

Collaborators

  • pascalw