1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Fixed a new daylight savings sync issue

This commit is contained in:
Jon Ziebell 2024-08-27 22:23:45 -04:00
parent 6b1533f852
commit 0b5f1e13b8
2 changed files with 17 additions and 0 deletions

View File

@ -282,6 +282,17 @@ class ecobee extends external_api {
$this->log_mysql($curl_response, true);
}
throw new cora\exception('No thermostats found.', 10511, false, null, false);
} else if (
isset($response['status']['message']) === true &&
stripos($response['status']['message'], 'Processing error.') !== false
) {
// Processing error. Generic error...this started happening in August
// 2024 when attempting to sync any date range that included
// the "missing hour" from daylight savings.
if($this::$log_mysql !== 'all') {
$this->log_mysql($curl_response, true);
}
throw new cora\exception('Generic processing error.', 10512, false, null, false);
}
}
else if (isset($response['status']) === true && $response['status']['code'] !== 0) {

View File

@ -405,6 +405,12 @@ class runtime extends cora\api {
strtotime('-1 hour', $begin),
strtotime('+1 hour', $end)
);
} else if($e->getCode() === 10512) {
// Processing error. Just pretend it worked and move on.
return [
'data_begin' => $begin,
'data_end' => $end
];
} else {
throw new cora\exception($e->getMessage(), $e->getCode(), $e->getReportable(), $e->getExtraInfo(), $e->getRollback());
}