From d9249c207f482048b7f7bca5f109f2b4bd33a47b Mon Sep 17 00:00:00 2001
From: echicken <echicken@bbs.electronicchicken.com>
Date: Fri, 26 Apr 2024 05:55:28 +0000
Subject: [PATCH] Debug output if wanted

---
 build/synctastic.js    | 2 ++
 src/modules/weather.ts | 1 +
 2 files changed, 3 insertions(+)

diff --git a/build/synctastic.js b/build/synctastic.js
index 211ef99..9ddc6df 100644
--- a/build/synctastic.js
+++ b/build/synctastic.js
@@ -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);
diff --git a/src/modules/weather.ts b/src/modules/weather.ts
index 4632d84..4f9e873 100644
--- a/src/modules/weather.ts
+++ b/src/modules/weather.ts
@@ -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(', ');
-- 
GitLab