Refactor watering scale logic flow

This commit is contained in:
Matthew Oslan
2019-06-28 00:33:00 -04:00
parent 95dadf601d
commit dc171ebe68
11 changed files with 70 additions and 50 deletions

View File

@@ -50,20 +50,23 @@ export interface WeatherDataForecast {
description: string;
}
export interface BaseWateringData {
/** The WeatherProvider that generated this data. */
weatherProvider: WeatherProviderId;
/** The total precipitation over the window (in inches). */
precip: number;
}
/**
* Data from a 24 hour window that is used to calculate how watering levels should be scaled. This should ideally use
* historic data from the past day, but may also use forecasted data for the next day if historical data is not
* available.
*/
export interface WateringData {
/** The WeatherProvider that generated this data. */
weatherProvider: WeatherProviderId;
export interface ZimmermanWateringData extends BaseWateringData {
/** The average temperature over the window (in Fahrenheit). */
temp: number;
/** The average humidity over the window (as a percentage). */
humidity: number;
/** The total precipitation over the window (in inches). */
precip: number;
/** A boolean indicating if it is raining at the time that this data was retrieved. */
raining: boolean;
}