Skip to content
Snippets Groups Projects
Commit d9249c20 authored by echicken's avatar echicken :chicken:
Browse files

Debug output if wanted

parent 632dbb2c
Branches
No related tags found
No related merge requests found
......@@ -16845,6 +16845,8 @@
exclude: ["minutely", "hourly", "daily", "alerts"],
units: "metric"
});
if (this.config.debug)
this.log(sbbsdefs.LOG_DEBUG, "Weather API response: ".concat(weather));
if (weather.current === void 0)
return false;
var wd = openWeatherMap.wind_direction(weather.current.wind_deg);
......
......@@ -37,6 +37,7 @@ export default class Weather extends Module {
const lat = nodeInfo.position.latitudeI * .0000001;
const lon = nodeInfo.position.longitudeI * .0000001;
const weather = openWeatherMap.call_api_v3({ lat, lon, exclude: ['minutely', 'hourly', 'daily', 'alerts'], units: 'metric' });
if (this.config.debug) this.log(sbbsdefs.LOG_DEBUG, `Weather API response: ${weather}`);
if (weather.current === undefined) return false;
const wd = openWeatherMap.wind_direction(weather.current.wind_deg);
const conditions = weather.current.weather.map(e => e.main).join(', ');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment