Add default implementations to WeatherProvider

This commit is contained in:
Matthew Oslan
2019-06-06 16:17:06 -04:00
parent 8368991c67
commit b57b019295
2 changed files with 10 additions and 14 deletions

View File

@@ -5,15 +5,21 @@ export class 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 rejected with an error message if an error occurs while retrieving the WateringData.
* or rejected with an error message if an error occurs while retrieving the WateringData or the WeatherProvider
* does not support this method.
*/
getWateringData?( coordinates : GeoCoordinates ): Promise< WateringData >;
getWateringData( coordinates : GeoCoordinates ): Promise< WateringData > {
throw "Selected WeatherProvider does not support getWateringData";
}
/**
* 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 rejected with an error message if an error occurs while retrieving the WeatherData.
* or rejected with an error message if an error occurs while retrieving the WeatherData or the WeatherProvider does
* not support this method.
*/
getWeatherData?( coordinates : GeoCoordinates ): Promise< WeatherData >;
getWeatherData( coordinates : GeoCoordinates ): Promise< WeatherData > {
throw "Selected WeatherProvider does not support getWeatherData";
}
}