Convert WeatherProvider from interface to class

This commit is contained in:
Matthew Oslan
2019-06-06 16:11:59 -04:00
parent 16b13c1e43
commit 8368991c67
6 changed files with 222 additions and 228 deletions

View File

@@ -5,8 +5,9 @@ import * as SunCalc from "suncalc";
import * as moment from "moment-timezone";
import * as geoTZ from "geo-tz";
import { AdjustmentOptions, GeoCoordinates, TimeData, WateringData, WeatherData, WeatherProvider } from "../types";
const weatherProvider: WeatherProvider = require("./weatherProviders/" + ( process.env.WEATHER_PROVIDER || "OWM" ) ).default;
import { AdjustmentOptions, GeoCoordinates, TimeData, WateringData, WeatherData } from "../types";
import { WeatherProvider } from "./weatherProviders/WeatherProvider";
const weatherProvider: WeatherProvider = new ( require("./weatherProviders/" + ( process.env.WEATHER_PROVIDER || "OWM" ) ).default )();
// Define regex filters to match against location
const filters = {