lower scroll station info from correct station

This commit is contained in:
Matt Walsh 2020-10-16 15:23:40 -05:00
parent eeeb7ec3e8
commit 165fbd7018
3 changed files with 2 additions and 10 deletions

View file

@ -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);

View file

@ -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,
};
})();

View file

@ -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);