Fix bug with updated geo-tz package
This commit is contained in:
@@ -89,7 +89,7 @@ async function getLocalWateringData( coordinates: GeoCoordinates ): Promise< Wat
|
|||||||
* @return The TimeData for the specified coordinates.
|
* @return The TimeData for the specified coordinates.
|
||||||
*/
|
*/
|
||||||
function getTimeData( coordinates: GeoCoordinates ): TimeData {
|
function getTimeData( coordinates: GeoCoordinates ): TimeData {
|
||||||
const timezone = moment().tz( geoTZ( coordinates[ 0 ], coordinates[ 1 ] ) ).utcOffset();
|
const timezone = moment().tz( geoTZ( coordinates[ 0 ], coordinates[ 1 ] )[ 0 ] ).utcOffset();
|
||||||
const tzOffset: number = getTimezone( timezone, true );
|
const tzOffset: number = getTimezone( timezone, true );
|
||||||
|
|
||||||
// Calculate sunrise and sunset since Weather Underground does not provide it
|
// Calculate sunrise and sunset since Weather Underground does not provide it
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import { config } from "dotenv"
|
||||||
import * as express from "express";
|
import * as express from "express";
|
||||||
import * as cors from "cors";
|
import * as cors from "cors";
|
||||||
import * as dotenv from "dotenv";
|
|
||||||
|
|
||||||
import * as weather from "./routes/weather";
|
import * as weather from "./routes/weather";
|
||||||
import * as local from "./routes/local";
|
import * as local from "./routes/local";
|
||||||
@@ -13,13 +13,6 @@ let host = process.env.HOST || "127.0.0.1",
|
|||||||
export let pws = process.env.PWS || "none";
|
export let pws = process.env.PWS || "none";
|
||||||
export const app = express();
|
export const app = express();
|
||||||
|
|
||||||
if ( !process.env.HOST || !process.env.PORT || !process.env.LOCAL_PWS ) {
|
|
||||||
dotenv.config();
|
|
||||||
host = process.env.HOST || host;
|
|
||||||
port = parseInt( process.env.PORT ) || port;
|
|
||||||
pws = process.env.PWS || pws;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle requests matching /weatherID.py where ID corresponds to the
|
// Handle requests matching /weatherID.py where ID corresponds to the
|
||||||
// weather adjustment method selector.
|
// weather adjustment method selector.
|
||||||
// This endpoint is considered deprecated and supported for prior firmware
|
// This endpoint is considered deprecated and supported for prior firmware
|
||||||
|
|||||||
Reference in New Issue
Block a user