weather for openframeworks, current providers: openweathermap
README
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``
c++ 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(); }
Optional: Set Units of Measurement
c++ // 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.2Known issues
Roadmap
- [x] additional units:
- standard, metric, and imperial support
- [x] rain/snow
- [x] humidity
- [x] 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
Get this addon
Latest release
v0.0.2
published 4y ago
- added humidity
- added local file support (example loads a cached json)
Full Changelog: https://github.com/pce/ofxAbstractWeather/compare/v0.0.1...v0.0.2
ofxAddons