This commit is contained in:
Stephen Vanderwarker 2022-04-23 23:31:11 -04:00
commit 4bf12d42ab

View File

@ -399,11 +399,11 @@ try {
let wmc = weather_city_name + " Weather: Tempature: " + w.main.temp + " degrees. Conditions: " + w.weather[0].main + ". Pressure: " + let wmc = weather_city_name + " Weather: Tempature: " + w.main.temp + " degrees. Conditions: " + w.weather[0].main + ". Pressure: " +
w.main.pressure + ". Wind Direction: " + getDirection(w.wind.deg) + ". Wind Speed: " + w.wind.speed + " miles per hour \r\n"; w.main.pressure + ". Wind Direction: " + getDirection(w.wind.deg) + ". Wind Speed: " + w.wind.speed + " miles per hour \r\n";
// send weather to mqtt // send weather to mqtt
client.publish('weather/temp', 'w.main.temp'); client.publish('weather/temp', '' + w.main.temp + '');
client.publish('weather/conditions', 'w.weather[0].main'); client.publish('weather/conditions', '' + w.weather[0].main + '');
client.publish('weather/pressure', 'w.main.pressure'); client.publish('weather/pressure', '' + w.main.pressure + '');
client.publish('weather/wind/direction', 'getDirection(w.wind.deg)'); client.publish('weather/wind/direction', '' + getDirection(w.wind.deg) + '');
client.publish('weather/wind/speed', 'w.wind.speed'); client.publish('weather/wind/speed', '' + w.wind.speed + '');
// send weather to xmpp admin // send weather to xmpp admin
xmpp.send(from, wm); xmpp.send(from, wm);
// call admin with latest weather report // call admin with latest weather report