Skip to content

Commit

Permalink
Standardize Abbreviating "ID"
Browse files Browse the repository at this point in the history
  • Loading branch information
leoherzog committed Sep 16, 2024
1 parent a4d5613 commit b39404d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
const datasource = 'weatherflow'; // 'ibm' (wunderground), 'acurite' (myacurite), 'davis' (weatherlink), 'weatherflow' (tempestwx), 'ambient' (ambient weather), 'aprs' (aprs.fi), or 'custom' (custom webhook in rtl_433 format)

const ibmAPIKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const ibmStationId = 'KXXXXXXXXXX';
const ibmStationID = 'KXXXXXXXXXX';
// or
const acuriteUsername = '[email protected]';
const acuritePassword = 'xxxxxxxxxxxxxxxxxx';
Expand All @@ -36,12 +36,12 @@ const customStationLon = 'xx.xxxxxx';
// Sending data

const updateWunderground = false;
const wundergroundStationId = 'KXXXXXXXXXX';
const wundergroundStationID = 'KXXXXXXXXXX';
const wundergroundStationKey = 'xxxxxxxx';
///
const updateWindy = false;
const windyAPIKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const windyStationId = '0';
const windyStationID = '0';
///
const updatePWSWeather = false;
const pwsWeatherAPIKey = 'XXXXXXXXXXX';
Expand Down Expand Up @@ -132,7 +132,7 @@ function Schedule() {
// https://www.wunderground.com/member/api-keys
function refreshFromIBM_() {

let ibmConditions = fetchJSON_('https://api.weather.com/v2/pws/observations/current?stationId=' + ibmStationId + '&format=json&units=e&numericPrecision=decimal&apiKey=' + ibmAPIKey);
let ibmConditions = fetchJSON_('https://api.weather.com/v2/pws/observations/current?stationId=' + ibmStationID + '&format=json&units=e&numericPrecision=decimal&apiKey=' + ibmAPIKey);
if (!ibmConditions) return false; // still no luck? give up

// console.log(JSON.stringify(ibmConditions));
Expand Down Expand Up @@ -813,7 +813,7 @@ function updateWunderground_() {
let conditions = JSON.parse(CacheService.getScriptCache().get('conditions'));

let request = 'https://rtupdate.wunderground.com/weatherstation/updateweatherstation.php';
request += '?ID=' + wundergroundStationId;
request += '?ID=' + wundergroundStationID;
request += '&PASSWORD=' + wundergroundStationKey;
request += '&dateutc=' + encodeURIComponent(Utilities.formatDate(new Date(conditions.time), 'UTC', 'yyyy-MM-dd HH:mm:ss'));
if (conditions.temp != null) request += '&tempf=' + conditions.temp.f;
Expand Down Expand Up @@ -843,7 +843,7 @@ function updateWindy_() {
let conditions = JSON.parse(CacheService.getScriptCache().get('conditions'));

let request = 'https://stations.windy.com/pws/update/' + windyAPIKey;
request += '?stationId=' + windyStationId;
request += '?stationId=' + windyStationID;
request += '&time=' + new Date(conditions.time).toISOString();
if (conditions.temp != null) request += '&tempf=' + conditions.temp.f;
if (conditions.dewpoint != null) request += '&dewptf=' + conditions.dewpoint.f;
Expand Down

0 comments on commit b39404d

Please sign in to comment.