Allow dynamic selection of weather provider

This commit is contained in:
Matthew Oslan
2019-05-12 01:55:00 -04:00
parent 31af9d3320
commit ee31e736ba
3 changed files with 115 additions and 100 deletions

View File

@@ -63,3 +63,21 @@ export interface AdjustmentOptions {
/** The rain delay to use (in hours). */
d?: number;
}
export interface WeatherProvider {
/**
* Retrieves weather data necessary for watering level calculations.
* @param coordinates The coordinates to retrieve the watering data for.
* @return A Promise that will be resolved with the WateringData if it is successfully retrieved,
* or resolved with undefined if an error occurs while retrieving the WateringData.
*/
getWateringData( coordinates : GeoCoordinates ): Promise< WateringData >;
/**
* Retrieves the current weather data for usage in the mobile app.
* @param coordinates The coordinates to retrieve the weather for
* @return A Promise that will be resolved with the WeatherData if it is successfully retrieved,
* or resolved with undefined if an error occurs while retrieving the WeatherData.
*/
getWeatherData( coordinates : GeoCoordinates ): Promise< WeatherData >;
}