diff --git a/server/scripts/modules/currentweather.js b/server/scripts/modules/currentweather.js index 44e821a..a196110 100644 --- a/server/scripts/modules/currentweather.js +++ b/server/scripts/modules/currentweather.js @@ -82,6 +82,7 @@ class CurrentWeather extends WeatherDisplay { data.Icon = icons.getWeatherIconFromIconLink(observations.icon); data.PressureDirection = ''; data.TextConditions = observations.textDescription; + data.station = this.data.station; // difference since last measurement (pascals, looking for difference of more than 150) const pressureDiff = (observations.barometricPressure.value - this.data.features[1].properties.barometricPressure.value); diff --git a/server/scripts/modules/currentweatherscroll.js b/server/scripts/modules/currentweatherscroll.js index 2ec3531..2f3e1a7 100644 --- a/server/scripts/modules/currentweatherscroll.js +++ b/server/scripts/modules/currentweatherscroll.js @@ -64,7 +64,6 @@ const currentWeatherScroll = (() => { // nothing to do if there's no data yet if (!data) return; - if (!station) return; // clean up any old text context.putImageData(blankDrawArea, 0, 405); @@ -75,7 +74,7 @@ const currentWeatherScroll = (() => { // the "screens" are stored in an array for easy addition and removal const screens = [ // station name - () => `Conditions at ${station.name.substr(0,20)}`, + (data) => `Conditions at ${data.station.properties.name.substr(0,20)}`, // temperature (data) => { @@ -117,15 +116,9 @@ const currentWeatherScroll = (() => { draw.text(context, 'Star4000', '24pt', '#ffffff', 70, 430, text, 2); }; - // store the latest station data - const setStation = (weatherParameters) => { - station = weatherParameters.stations[0].properties; - }; - // return the api return { start, stop, - setStation, }; })(); \ No newline at end of file diff --git a/server/scripts/modules/navigation.js b/server/scripts/modules/navigation.js index 91d492e..9cc7512 100644 --- a/server/scripts/modules/navigation.js +++ b/server/scripts/modules/navigation.js @@ -107,8 +107,6 @@ const navigation = (() => { } // call for new data on each display displays.forEach(display => display.getData(weatherParameters)); - // pass the information to the bottom scroll - currentWeatherScroll.setStation(weatherParameters); // GetMonthPrecipitation(this.weatherParameters); // GetAirQuality3(this.weatherParameters);