From e1957bcfd9e137dd67eabbb90af1173fd40df16a Mon Sep 17 00:00:00 2001 From: "guilhem.carron" <gcarron@grandlyon.com> Date: Wed, 7 Jul 2021 15:14:39 +0200 Subject: [PATCH] add dju doc + edit function defintions --- docs/ecolyo/functionalities/profile_type.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/ecolyo/functionalities/profile_type.md b/docs/ecolyo/functionalities/profile_type.md index 446563f..065bb70 100644 --- a/docs/ecolyo/functionalities/profile_type.md +++ b/docs/ecolyo/functionalities/profile_type.md @@ -39,20 +39,21 @@ Here you can see the different methods provided by the profileType service. Thes | Method | Description | | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- | -| getMonthlyForecast(month: number) : MonthlyForecast | Used to get the monthly forecast for a given month | -| getFluidForecast(fluidType: FluidType, month: number) : FluidForecast | Used to get the monthly forecast for a given FluidType | -| getDetailsMonthlyForecast(fluidType: FluidType, month: number): DetailsMonthlyForecast | Used to get the details of a fluidForecast. For each fluid return the related consumptions. | +| getMonthlyForecast(month: number) : Promise-MonthlyForecast | Used to get the monthly forecast for a given month | +| getFluidForecast(fluidType: FluidType, month: number) : Promise-FluidForecast | Used to get the monthly forecast for a given FluidType | +| getDetailsMonthlyForecast(fluidType: FluidType, month: number): Promise-DetailsMonthlyForecast | Used to get the details of a fluidForecast. For each fluid return the related consumptions. | | getMonthColdWaterConsumption(month: number): number | Returns the cold water consumption in L for a given month | | getMonthElectricSpecificConsumption(month: number): number | Returns the electric specific consumption in kWh for a given month | | getMonthCookingConsumption(month: number): number | Returns the cooking consumption in kWh for a given month | | getMonthEcs(month: number) : number | Returns the hot water consumption in kWh for a given month | -| getMonthHeating(month: number): number | Returns the heating consumption in kWh for a given month | +| getMonthHeating(month: number): Promise-number | Returns the heating consumption in kWh for a given month | | calculateTotalConsumption(spreadConsumption: number, profileType: ProfileType, month: number) : number | Returns the total ECS consumption with applyied corrections to the spreadConsumption depending on users facilities. | | calculateSpreadNeeds(profileType: ProfileType, month: number): number | Calculate the water spread consumption | | calculateMonthWaterRawNeeds(profileType: ProfileType, month: number) : number | Returns the raw water needs of a home | | calculateWarmingEstimatedConsumption(): number | Calculates the estimated consumption of a home | | calculateWarmingCorrectedConsumption(estimatedConsumption: number): number | Apply the different corrections to the estimated heating consumption | -| calculateWarmingMonthConsumption(correctedConsumption: number, month: number): number | Apply dju ratio to the corrected heating consumption | +| calculateWarmingMonthConsumption(correctedConsumption: number, month: number): Promise-number | Apply dju ratio to the corrected heating consumption | +| fetchDJU(month: number): Promise-number | Returns a Promise with the dju for the given month | Here is an example of a MonthlyForecast, which is the only function directly called by the analyzis component : @@ -104,3 +105,8 @@ Here is an example of a MonthlyForecast, which is the only function directly cal In these data, the load is in kWh for gaz and electricity (fluidtype 0 and 2) and in L for water. Value and totalValue are given in euros. The different consumption are distributed to their corresponding fluidType according to the variables **_warmingFluid, hotWaterFluid, cookingFluid _**. For example, if the cookingFluid is gaz, then its value will be stored in the fluidType 2 and nulled in the others. Also, we consider that if the heating or the hotwater are collective, we don't calcute it because the user can never access his personnal consumption, so it doesn't takes place in the calculation. + +## DJU + +The method **fetchDJU(month:number)** tries to fetch the daily dju from the datagrandlyon API trough a remote doctype named _org.ecolyo.dju_. +The data returned by this API are gathered by the lyon-bron-sta The API returns dju by day for a given month, so we add them to return a monthly dju. If remote doctype fails or return a null value, we returns instead the default dju stored in _heating.json_ -- GitLab