diff --git a/app/ecolyo.1c9a4182f7e76618589e.js b/app/ecolyo.dbb57f18292ef1c7a588.js similarity index 99% rename from app/ecolyo.1c9a4182f7e76618589e.js rename to app/ecolyo.dbb57f18292ef1c7a588.js index 2c035cf31155ffb8621feb0fba9794785ee0ffdf..627c46419423ba55c6d155339d3f4fc779d87f11 100644 --- a/app/ecolyo.1c9a4182f7e76618589e.js +++ b/app/ecolyo.dbb57f18292ef1c7a588.js @@ -7680,7 +7680,7 @@ var ProfileTypeService = /*#__PURE__*/function () { (0, _defineProperty2.default)(this, "year", void 0); (0, _defineProperty2.default)(this, "fetchDJU", /*#__PURE__*/function () { var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(month) { - var startDate, endDate, result, monthDju, degreeDayObservations, _monthDju, _iterator, _step, observation, errorMessage; + var startDate, endDate, result, monthDju, degreeDayObservations, _iterator, _step, observation, errorMessage; return _regenerator.default.wrap(function _callee$(_context) { while (1) { @@ -7692,43 +7692,37 @@ var ProfileTypeService = /*#__PURE__*/function () { year: _this.year }).set({ month: month - }).startOf('month').minus({ - minutes: 5 - }).toISO(); + }).startOf('month').toISO(); endDate = _luxon.DateTime.local().setZone('utc', { keepLocalTime: true }).set({ year: _this.year }).set({ month: month - }).endOf('month').plus({ - minutes: 5 - }).toISO(); - console.log('MY DATE : ', startDate, endDate); // We add or remove 5 minutes so the api returns the exact period + }).endOf('month').toISO(); // We add or remove 5 minutes so the api returns the exact period - _context.prev = 3; - _context.next = 6; + _context.prev = 2; + _context.next = 5; return _this._client.getStackClient().fetchJSON('GET', "/remote/org.ecolyo.dju_v2?startDate=".concat(startDate, "&endDate=").concat(endDate)); - case 6: + case 5: result = _context.sent; monthDju = 0; if (!result) { - _context.next = 18; + _context.next = 16; break; } degreeDayObservations = result.values.filter(function (value) { return value.observation === 'degreeDay'; }); - _monthDju = 0; _iterator = _createForOfIteratorHelper(degreeDayObservations); try { for (_iterator.s(); !(_step = _iterator.n()).done;) { observation = _step.value; - _monthDju += observation.measurement; + monthDju += observation.measurement; } } catch (err) { _iterator.e(err); @@ -7736,36 +7730,34 @@ var ProfileTypeService = /*#__PURE__*/function () { _iterator.f(); } - if (!(_monthDju === 0)) { - _context.next = 17; + if (!(monthDju === 0)) { + _context.next = 15; break; } return _context.abrupt("return", _heating.default.dju_average_by_month[month - 1]); - case 17: - return _context.abrupt("return", _monthDju); - - case 18: - console.log('DJU MONTH : ', monthDju); + case 15: + return _context.abrupt("return", monthDju); + case 16: if (!(monthDju === 0)) { - _context.next = 23; + _context.next = 20; break; } return _context.abrupt("return", _heating.default.dju_average_by_month[month - 1]); - case 23: + case 20: return _context.abrupt("return", monthDju); - case 24: - _context.next = 33; + case 21: + _context.next = 30; break; - case 26: - _context.prev = 26; - _context.t0 = _context["catch"](3); + case 23: + _context.prev = 23; + _context.t0 = _context["catch"](2); errorMessage = "fetchDju error : ".concat(JSON.stringify(_context.t0)); logStack('error', errorMessage); @@ -7774,12 +7766,12 @@ var ProfileTypeService = /*#__PURE__*/function () { Sentry.captureException(errorMessage); return _context.abrupt("return", _heating.default.dju_average_by_month[month - 1]); - case 33: + case 30: case "end": return _context.stop(); } } - }, _callee, null, [[3, 26]]); + }, _callee, null, [[2, 23]]); })); return function (_x) { diff --git a/index.html b/index.html index 23e9cd9bd7e0c593ccddbf3fa5a9aacc8784e28c..ba0cc642ed1a061f002ceeda7e97d34c49ba3ff2 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.69beab954af56959f24c.js"></script><script src="app/ecolyo.1c9a4182f7e76618589e.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.69beab954af56959f24c.js"></script><script src="app/ecolyo.dbb57f18292ef1c7a588.js"></script></div></body></html> \ No newline at end of file