Add attribution to Watering Data

This commit is contained in:
Pete ba
2019-10-27 14:29:37 +00:00
parent 4806428c84
commit 0f2607bb19
4 changed files with 9 additions and 1 deletions

View File

@@ -54,6 +54,7 @@ async function calculateEToWateringScale(
return { return {
scale: scale, scale: scale,
rawData: { rawData: {
weatherProvider: etoData.weatherProvider,
eto: Math.round( eto * 1000) / 1000, eto: Math.round( eto * 1000) / 1000,
radiation: Math.round( etoData.solarRadiation * 100) / 100, radiation: Math.round( etoData.solarRadiation * 100) / 100,
minT: Math.round( etoData.minTemp ), minT: Math.round( etoData.minTemp ),

View File

@@ -7,6 +7,9 @@ import { AdjustmentMethod, AdjustmentMethodResponse } from "./AdjustmentMethod";
async function calculateManualWateringScale( ): Promise< AdjustmentMethodResponse > { async function calculateManualWateringScale( ): Promise< AdjustmentMethodResponse > {
return { return {
scale: undefined, scale: undefined,
rawData: {
weatherProvider: "Manual",
},
wateringData: undefined wateringData: undefined
} }
} }

View File

@@ -12,7 +12,10 @@ async function calculateRainDelayWateringScale( adjustmentOptions: RainDelayAdju
const d = adjustmentOptions.hasOwnProperty( "d" ) ? adjustmentOptions.d : 24; const d = adjustmentOptions.hasOwnProperty( "d" ) ? adjustmentOptions.d : 24;
return { return {
scale: undefined, scale: undefined,
rawData: { raining: raining ? 1 : 0 }, rawData: {
weatherProvider: wateringData.weatherProvider,
raining: raining ? 1 : 0,
},
rainDelay: raining ? d : undefined, rainDelay: raining ? d : undefined,
wateringData: wateringData wateringData: wateringData
} }

View File

@@ -30,6 +30,7 @@ async function calculateZimmermanWateringScale(
*/ */
const rawData = { const rawData = {
weatherProvider: wateringData.weatherProvider,
h: wateringData ? Math.round( wateringData.humidity * 100) / 100 : null, h: wateringData ? Math.round( wateringData.humidity * 100) / 100 : null,
p: wateringData ? Math.round( wateringData.precip * 100 ) / 100 : null, p: wateringData ? Math.round( wateringData.precip * 100 ) / 100 : null,
t: wateringData ? Math.round( wateringData.temp * 10 ) / 10 : null, t: wateringData ? Math.round( wateringData.temp * 10 ) / 10 : null,