1
0
mirror of https://github.com/beestat/app.git synced 2026-04-13 04:32:31 -04:00

Fixed data clamping on download to use thermostat data begin and data end instead of first connected

first_connected is not always accurate in the case of merged thermostats
This commit is contained in:
Jon Ziebell 2025-10-11 06:28:50 -04:00
parent c347ffba8c
commit dd8bf6ff3e

View File

@ -979,11 +979,11 @@ class runtime extends cora\api {
// Clamp
$download_begin = strtotime($download_begin);
$download_begin = max(strtotime($thermostat['first_connected']), $download_begin);
$download_begin = max(strtotime($thermostat['data_begin']), $download_begin);
$download_begin = min(time(), $download_begin);
$download_end = strtotime($download_end);
$download_end = max(strtotime($thermostat['first_connected']), $download_end);
$download_end = max(strtotime($thermostat['data_begin']), $download_end);
$download_end = min(time(), $download_end);
// Round begin/end down to the next 5 minutes.