mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-22 19:49:31 -07:00
lower scroll station info from correct station
This commit is contained in:
@@ -82,6 +82,7 @@ class CurrentWeather extends WeatherDisplay {
|
|||||||
data.Icon = icons.getWeatherIconFromIconLink(observations.icon);
|
data.Icon = icons.getWeatherIconFromIconLink(observations.icon);
|
||||||
data.PressureDirection = '';
|
data.PressureDirection = '';
|
||||||
data.TextConditions = observations.textDescription;
|
data.TextConditions = observations.textDescription;
|
||||||
|
data.station = this.data.station;
|
||||||
|
|
||||||
// difference since last measurement (pascals, looking for difference of more than 150)
|
// difference since last measurement (pascals, looking for difference of more than 150)
|
||||||
const pressureDiff = (observations.barometricPressure.value - this.data.features[1].properties.barometricPressure.value);
|
const pressureDiff = (observations.barometricPressure.value - this.data.features[1].properties.barometricPressure.value);
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ const currentWeatherScroll = (() => {
|
|||||||
|
|
||||||
// nothing to do if there's no data yet
|
// nothing to do if there's no data yet
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
if (!station) return;
|
|
||||||
|
|
||||||
// clean up any old text
|
// clean up any old text
|
||||||
context.putImageData(blankDrawArea, 0, 405);
|
context.putImageData(blankDrawArea, 0, 405);
|
||||||
@@ -75,7 +74,7 @@ const currentWeatherScroll = (() => {
|
|||||||
// the "screens" are stored in an array for easy addition and removal
|
// the "screens" are stored in an array for easy addition and removal
|
||||||
const screens = [
|
const screens = [
|
||||||
// station name
|
// station name
|
||||||
() => `Conditions at ${station.name.substr(0,20)}`,
|
(data) => `Conditions at ${data.station.properties.name.substr(0,20)}`,
|
||||||
|
|
||||||
// temperature
|
// temperature
|
||||||
(data) => {
|
(data) => {
|
||||||
@@ -117,15 +116,9 @@ const currentWeatherScroll = (() => {
|
|||||||
draw.text(context, 'Star4000', '24pt', '#ffffff', 70, 430, text, 2);
|
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 the api
|
||||||
return {
|
return {
|
||||||
start,
|
start,
|
||||||
stop,
|
stop,
|
||||||
setStation,
|
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
@@ -107,8 +107,6 @@ const navigation = (() => {
|
|||||||
}
|
}
|
||||||
// call for new data on each display
|
// call for new data on each display
|
||||||
displays.forEach(display => display.getData(weatherParameters));
|
displays.forEach(display => display.getData(weatherParameters));
|
||||||
// pass the information to the bottom scroll
|
|
||||||
currentWeatherScroll.setStation(weatherParameters);
|
|
||||||
|
|
||||||
// GetMonthPrecipitation(this.weatherParameters);
|
// GetMonthPrecipitation(this.weatherParameters);
|
||||||
// GetAirQuality3(this.weatherParameters);
|
// GetAirQuality3(this.weatherParameters);
|
||||||
|
|||||||
Reference in New Issue
Block a user