mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 07:39:29 -07:00
Allow for station data overrides #125
This commit is contained in:
@@ -13350,6 +13350,13 @@ const StationInfo = {
|
||||
lat: 38.7578,
|
||||
lon: -104.3013,
|
||||
},
|
||||
KAEJ: {
|
||||
id: 'KAEJ',
|
||||
city: 'Central Colorado Regional Airport',
|
||||
state: 'CO',
|
||||
lat: 38.81416,
|
||||
lon: -106.12069,
|
||||
},
|
||||
KAFF: {
|
||||
id: 'KAFF',
|
||||
city: 'Air Force Academy',
|
||||
@@ -13357,13 +13364,6 @@ const StationInfo = {
|
||||
lat: 38.96667,
|
||||
lon: -104.81667,
|
||||
},
|
||||
KAIB: {
|
||||
id: 'KAIB',
|
||||
city: 'Nucla Hopkins Field Airport',
|
||||
state: 'CO',
|
||||
lat: 38.23875,
|
||||
lon: -108.563277,
|
||||
},
|
||||
KAJZ: {
|
||||
id: 'KAJZ',
|
||||
city: 'Delta/Blake Field Airport',
|
||||
@@ -13415,7 +13415,7 @@ const StationInfo = {
|
||||
},
|
||||
KBJC: {
|
||||
id: 'KBJC',
|
||||
city: 'Broomfield / Jeffco',
|
||||
city: 'Rocky Mountain Metro',
|
||||
state: 'CO',
|
||||
lat: 39.90085,
|
||||
lon: -105.10417,
|
||||
|
||||
@@ -114,11 +114,14 @@ class CurrentWeather extends WeatherDisplay {
|
||||
|
||||
const wind = (typeof this.data.WindSpeed === 'number') ? this.data.WindDirection.padEnd(3, '') + this.data.WindSpeed.toString().padStart(3, ' ') : this.data.WindSpeed;
|
||||
|
||||
// get location (city name) from StationInfo if available (allows for overrides)
|
||||
const location = (StationInfo[this.data.station.properties.stationIdentifier]?.city ?? locationCleanup(this.data.station.properties.name)).substr(0, 20);
|
||||
|
||||
const fill = {
|
||||
temp: this.data.Temperature + String.fromCharCode(176),
|
||||
condition,
|
||||
wind,
|
||||
location: locationCleanup(this.data.station.properties.name).substr(0, 20),
|
||||
location,
|
||||
humidity: `${this.data.Humidity}%`,
|
||||
dewpoint: this.data.DewPoint + String.fromCharCode(176),
|
||||
ceiling: (this.data.Ceiling === 0 ? 'Unlimited' : this.data.Ceiling + this.data.CeilingUnit),
|
||||
|
||||
@@ -133,7 +133,10 @@ const baseScreens = [
|
||||
// hazards
|
||||
hazards,
|
||||
// station name
|
||||
(data) => `Conditions at ${locationCleanup(data.station.properties.name).substr(0, 20)}`,
|
||||
(data) => {
|
||||
const location = (StationInfo[data.station.properties.stationIdentifier]?.city ?? locationCleanup(data.station.properties.name)).substr(0, 20);
|
||||
return `Conditions at ${location}`;
|
||||
},
|
||||
|
||||
// temperature
|
||||
(data) => {
|
||||
|
||||
Reference in New Issue
Block a user