Skip to content

weather for openframeworks, current providers: openweathermap

License

Notifications You must be signed in to change notification settings

pce/ofxAbstractWeather

Repository files navigation

ofxAbstractWeather

Introduction

OpenFrameworks Weather-Data addon.

Usage/Examples

Create an API-Key at OpenWeatherMap or weather.setHasLocalFile(true) loads for example: bin/data/openweathermap.json

void ofApp::setup(){
    weather.setApiKey(apiKey);
    weather.setCityAndCountryCode(cityAndCountryCode);
    weather.parseData(weather.loadData());
}

void ofApp::update(){
    currentTemperature = weather.getCurrentTemperature();
    currentHumidity = weather.getCurrentHumidity();
    currentWindSpeed = weather.getCurrentWindSpeed();
    currentWindDirection = weather.getCurrentWindDirection();
    currentClouds = weather.getCurrentClouds();
    currentRain = weather.getPrecipitation();
    currentAvg = weather.getAverageTemperature();
    currentTempTrend = weather.getTemperatureTrend();
    currentAvgRain = weather.getAveragePrecipitation();
}

example_openweathermap

Optional: Set Units of Measurement

    // temperature in Celsius use "metric" (default)   
    // in Fahrenheit use "imperial", in Kelvin "standard"
    weather.setUnits("standard");

License

MIT License

Installation

Just drop the folder into the openFrameworks/addons/ folder.

Dependencies

No Dependencies.

Compatibility

Tested with OF 0.11.2

Known issues

Roadmap

  • additional units: - standard, metric, and imperial support
  • rain/snow
  • humidity
  • local file support
  • add default icons mapping
  • add more providers/integrations

Version history

Version 0.2 (2021-12-16):

  • humidity
  • local file support (example loads a cached json)

Version 0.1 (2021-12-15):

  • inital release

About

weather for openframeworks, current providers: openweathermap

Resources

License

Stars

Watchers

Forks

Packages

No packages published