diff --git a/README.md b/README.md index d7c001cc9d082083d57eb945fe5471638618d406..b25b56912533e54d1338a32e278e0107c0112791 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Ecolyo uses "konnectors" for fetching data. More on : ## Development -For a more complete look at our project, check our [Self Data Docs](https://doc.self-data.alpha.grandlyon.com/) +For a more complete look at our project, check our [Self Data Docs](https://doc-self-data.apps.grandlyon.com/) _:pushpin: Note:_ we recommend to use [Yarn] instead of NPM for package management. diff --git a/app/ecolyo.4a7da0fe743f1c380806.js b/app/ecolyo.175ed8f7a30d3914dcd4.js similarity index 99% rename from app/ecolyo.4a7da0fe743f1c380806.js rename to app/ecolyo.175ed8f7a30d3914dcd4.js index bd680543ea906e1d5b5a44f142ea8125aaadf8a9..df55e41beb89da9c333e2ab4b1cfa55e1103ec38 100644 --- a/app/ecolyo.4a7da0fe743f1c380806.js +++ b/app/ecolyo.175ed8f7a30d3914dcd4.js @@ -4615,18 +4615,19 @@ var ProfileTypeService = /*#__PURE__*/function () { } /** - * calculateWarmingEstimatedConsumption * @returns {number} Estimated consumption */ (0, _createClass2.default)(ProfileTypeService, [{ key: "calculateWarmingEstimatedConsumption", value: function calculateWarmingEstimatedConsumption() { var ratiosHeating = _heating.default.heating_ratio; - var housingType = this.profileType.housingType; - var constructionYear = this.profileType.constructionYear; + var _this$profileType = this.profileType, + area = _this$profileType.area, + constructionYear = _this$profileType.constructionYear, + housingType = _this$profileType.housingType; var ratiosHeatingByHousingType = ratiosHeating[housingType]; var currentRatio = ratiosHeatingByHousingType[constructionYear]; - var estimatedConsumption = parseInt(this.profileType.area) * currentRatio; + var estimatedConsumption = parseInt(area) * currentRatio; return estimatedConsumption; } @@ -4637,24 +4638,20 @@ var ProfileTypeService = /*#__PURE__*/function () { }, { key: "calculateWarmingCorrectedConsumption", value: function calculateWarmingCorrectedConsumption(estimatedConsumption) { - var outsideFacingWalls = this.profileType.outsideFacingWalls; - var housingType = this.profileType.housingType; - var floor = this.profileType.floor; - var constructionYear = this.profileType.constructionYear; - var individualInsulationWork = this.profileType.individualInsulationWork; - var hasInstalledVentilation = this.profileType.hasInstalledVentilation; - var hasReplacedHeater = this.profileType.hasReplacedHeater; - var heating = this.profileType.heating; - - // Apply corrections - var correctionsNbWalls = _heating.default.adjustment_outside_facing_walls[housingType]; - var correctionWalls = correctionsNbWalls[outsideFacingWalls]; - var correctionFloor; + var _this$profileType2 = this.profileType, + constructionYear = _this$profileType2.constructionYear, + floor = _this$profileType2.floor, + hasInstalledVentilation = _this$profileType2.hasInstalledVentilation, + hasReplacedHeater = _this$profileType2.hasReplacedHeater, + heating = _this$profileType2.heating, + housingType = _this$profileType2.housingType, + individualInsulationWork = _this$profileType2.individualInsulationWork, + outsideFacingWalls = _this$profileType2.outsideFacingWalls; var correctionInsulation; var correctionFacilities; - if (this.profileType.housingType === _enums.HousingType.APARTMENT) { - correctionFloor = _heating.default.adjustment_floor.apartment[floor]; - } else correctionFloor = 0; + var correctionsNbWalls = _heating.default.adjustment_outside_facing_walls[housingType]; + var correctionWalls = correctionsNbWalls[outsideFacingWalls]; + var correctionFloor = housingType === _enums.HousingType.APARTMENT ? _heating.default.adjustment_floor.apartment[floor] : 0; if (!individualInsulationWork.includes(_enums.IndividualInsulationWork.NONE) && constructionYear !== _enums.ConstructionYear.AFTER_1998 && heating !== _enums.IndividualOrCollective.COLLECTIVE) { var correctionsInsulation = _heating.default.adjustment_insulation[constructionYear]; if (individualInsulationWork.length === 1) { @@ -4687,8 +4684,7 @@ var ProfileTypeService = /*#__PURE__*/function () { } /** - * calculateWarmingMonthConsumption - @returns {number} monthConsumption + * @returns {number} monthConsumption */ }, { key: "calculateWarmingMonthConsumption", @@ -4718,7 +4714,6 @@ var ProfileTypeService = /*#__PURE__*/function () { return calculateWarmingMonthConsumption; }() /** - * getMonthHeating * @returns {number} Month heating consumption in kw/h */ }, { @@ -4755,9 +4750,10 @@ var ProfileTypeService = /*#__PURE__*/function () { */ }, { key: "calculateMonthWaterRawNeeds", - value: function calculateMonthWaterRawNeeds(profileType, month) { + value: function calculateMonthWaterRawNeeds(month) { + var _this2 = this; var waterNeedsIndex = _ecs.default.ecs_ratio.findIndex(function (ratio) { - return ratio.occupants_number === profileType.occupantsNumber; + return ratio.occupants_number === _this2.profileType.occupantsNumber; }); var waterNeeds = _ecs.default.ecs_ratio[waterNeedsIndex].warm_water_need_in_liter; var nbDaysInMonth = _luxon.DateTime.fromObject({ @@ -4774,10 +4770,10 @@ var ProfileTypeService = /*#__PURE__*/function () { */ }, { key: "calculateSpreadNeeds", - value: function calculateSpreadNeeds(profileType, month) { + value: function calculateSpreadNeeds(month) { var rawNeeds = []; for (var index = 1; index < 13; index++) { - rawNeeds.push(this.calculateMonthWaterRawNeeds(profileType, index)); + rawNeeds.push(this.calculateMonthWaterRawNeeds(index)); } var calculateTotalNeeds = function calculateTotalNeeds(accumulator, currentValue) { return accumulator + currentValue; @@ -4792,15 +4788,18 @@ var ProfileTypeService = /*#__PURE__*/function () { */ }, { key: "calculateTotalConsumption", - value: function calculateTotalConsumption(spreadConsumption, profileType, month) { + value: function calculateTotalConsumption(spreadConsumption, month) { + var _this$profileType3 = this.profileType, + housingType = _this$profileType3.housingType, + hotWaterEquipment = _this$profileType3.hotWaterEquipment; var coldWaterTemperature = _ecs.default.cold_water_temperature[month - 1]; - var efficiencyProduction = _ecs.default.efficiency_production_distribution[profileType.housingType]; + var efficiencyProduction = _ecs.default.efficiency_production_distribution[housingType]; var solarCoverage = _ecs.default.solar_coverage[month - 1]; var ecsConsumption = _ecs.default.coefficient_ecs_consumption * spreadConsumption / 1000 * (_ecs.default.hot_water_temperature - coldWaterTemperature) / efficiencyProduction; var monthEcsConsumption; - if (profileType.hotWaterEquipment === _enums.HotWaterEquipment.SOLAR) { + if (hotWaterEquipment === _enums.HotWaterEquipment.SOLAR) { monthEcsConsumption = ecsConsumption * (1 - solarCoverage); - } else if (profileType.hotWaterEquipment === _enums.HotWaterEquipment.THERMODYNAMIC) { + } else if (hotWaterEquipment === _enums.HotWaterEquipment.THERMODYNAMIC) { monthEcsConsumption = ecsConsumption / _ecs.default.coefficient_thermodynamic; } else { monthEcsConsumption = ecsConsumption; @@ -4814,8 +4813,8 @@ var ProfileTypeService = /*#__PURE__*/function () { }, { key: "getMonthEcs", value: function getMonthEcs(month) { - var spreadConsumption = this.calculateSpreadNeeds(this.profileType, month); - var monthEcsConsumption = this.calculateTotalConsumption(spreadConsumption, this.profileType, month); + var spreadConsumption = this.calculateSpreadNeeds(month); + var monthEcsConsumption = this.calculateTotalConsumption(spreadConsumption, month); return monthEcsConsumption; } /** @@ -4857,9 +4856,9 @@ var ProfileTypeService = /*#__PURE__*/function () { }, { key: "getMonthColdWaterConsumption", value: function getMonthColdWaterConsumption(month) { - var _this2 = this; + var _this3 = this; var occupantsNumberIndex = _coldWater.default.findIndex(function (waterNeeds) { - return waterNeeds.occupants_number === _this2.profileType.occupantsNumber; + return waterNeeds.occupants_number === _this3.profileType.occupantsNumber; }); var coldWaterNeeds = _coldWater.default[occupantsNumberIndex].consumption_in_liter_per_day; var nbDaysInMonth = _luxon.DateTime.fromObject({ @@ -4878,14 +4877,12 @@ var ProfileTypeService = /*#__PURE__*/function () { key: "getDetailsMonthlyForecast", value: function () { var _getDetailsMonthlyForecast = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(fluidType, month) { - var warmingFluid, hotWaterFluid, cookingFluid, detailsMonthlyForecast; + var _this$profileType4, cookingFluid, hotWaterFluid, warmingFluid, detailsMonthlyForecast; return _regenerator.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: - warmingFluid = this.profileType.warmingFluid; - hotWaterFluid = this.profileType.hotWaterFluid; - cookingFluid = this.profileType.cookingFluid; + _this$profileType4 = this.profileType, cookingFluid = _this$profileType4.cookingFluid, hotWaterFluid = _this$profileType4.hotWaterFluid, warmingFluid = _this$profileType4.warmingFluid; detailsMonthlyForecast = { heatingConsumption: null, ecsConsumption: null, @@ -4894,22 +4891,22 @@ var ProfileTypeService = /*#__PURE__*/function () { coldWaterConsumption: null }; if (!(this.profileType.heating !== _enums.IndividualOrCollective.COLLECTIVE)) { - _context4.next = 10; + _context4.next = 8; break; } if (!(warmingFluid !== null && fluidType === warmingFluid)) { - _context4.next = 9; + _context4.next = 7; break; } - _context4.next = 8; + _context4.next = 6; return this.getMonthHeating(month); - case 8: + case 6: detailsMonthlyForecast.heatingConsumption = _context4.sent; - case 9: + case 7: if (hotWaterFluid !== null && fluidType === hotWaterFluid) { detailsMonthlyForecast.ecsConsumption = this.getMonthEcs(month); } - case 10: + case 8: if (fluidType === cookingFluid) { detailsMonthlyForecast.cookingConsumption = this.getMonthCookingConsumption(month); } @@ -4920,7 +4917,7 @@ var ProfileTypeService = /*#__PURE__*/function () { detailsMonthlyForecast.coldWaterConsumption = this.getMonthColdWaterConsumption(month); } return _context4.abrupt("return", detailsMonthlyForecast); - case 14: + case 12: case "end": return _context4.stop(); } diff --git a/index.html b/index.html index 993017f34e06da197c4692494e75d9cd1f1b2875..ad4cc0edeea0aaf4d1893df2d843bdaea393d247 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.50523ef7f4b4a6406417.js"></script><script src="app/ecolyo.4a7da0fe743f1c380806.js"></script></div></body></html> \ No newline at end of file +<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.50523ef7f4b4a6406417.js"></script><script src="app/ecolyo.175ed8f7a30d3914dcd4.js"></script></div></body></html> \ No newline at end of file