Cache calculated watering scale when using data from Dark Sky

This commit is contained in:
Matthew Oslan
2019-07-03 16:26:14 -04:00
parent 2567e3a871
commit 5eb696c3e8
6 changed files with 192 additions and 76 deletions

View File

@@ -111,4 +111,8 @@ export default class DarkSkyWeatherProvider extends WeatherProvider {
return weather;
}
public shouldCacheWateringScale(): boolean {
return true;
}
}

View File

@@ -24,4 +24,13 @@ export class WeatherProvider {
getWeatherData( coordinates : GeoCoordinates ): Promise< WeatherData > {
throw "Selected WeatherProvider does not support getWeatherData";
}
/**
* Returns a boolean indicating if watering scales calculated using data from this WeatherProvider should be cached
* until the end of the day in timezone the data was for.
* @return a boolean indicating if watering scales calculated using data from this WeatherProvider should be cached.
*/
shouldCacheWateringScale(): boolean {
return false;
}
}