Skip to content

Commit 136a0a9

Browse files
committed
Fix missing time zone issue from API
1 parent c0c588c commit 136a0a9

File tree

7 files changed

+719
-1525
lines changed

7 files changed

+719
-1525
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
.env

ecobee/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class NodeBee {
387387
// process the csv row
388388
let values = row.split(',');
389389
// date and time are stored in the first two values
390-
const timestamp = DateTime.fromFormat(`${values[0]} ${values[1]}`, 'yyyy-MM-dd HH:mm:ss', { zone: thermostat.location.timeZone }).setZone('UTC').toJSDate();
390+
const timestamp = DateTime.fromFormat(`${values[0]} ${values[1]}`, 'yyyy-MM-dd HH:mm:ss', { zone: thermostat.location.timeZoneOffsetMinutes ?? thermostat.location.timeZone }).setZone('UTC').toJSDate();
391391
// add the id and date/time to the row, removing the first two values in the array (date and time, already used above)
392392
values = values.slice(2);
393393
values.unshift(
@@ -445,7 +445,7 @@ class NodeBee {
445445
const [date, time, ...sensorValues] = sensor.split(',');
446446

447447
// convert date and time into timestamp
448-
const timestamp = DateTime.fromFormat(`${date} ${time}`, 'yyyy-MM-dd HH:mm:ss', { zone: thermostat.location.timeZone }).setZone('UTC').toJSDate();
448+
const timestamp = DateTime.fromFormat(`${date} ${time}`, 'yyyy-MM-dd HH:mm:ss', { zone: thermostat.location.timeZoneOffsetMinutes ?? thermostat.location.timeZone }).setZone('UTC').toJSDate();
449449

450450
// loop through remaining values
451451
sensorValues.forEach((value, j) => {

0 commit comments

Comments
 (0)