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

Fixed #247 - Primary thermostat missing on Sensor Detail

This commit is contained in:
Jon Ziebell 2020-02-18 18:54:50 -05:00
parent 5f2efbc7ba
commit adfd70c13a

View File

@ -744,7 +744,7 @@ class runtime extends cora\api {
// Create or update the database
foreach ($datas as $data) {
if(isset($data['temperature']) === true && isset($data['occupancy']) === true) {
if(isset($data['temperature']) === true || isset($data['occupancy']) === true) {
if(isset($existing_timestamps[$data['sensor_id']][$data['timestamp']]) === true) {
$data['runtime_sensor_id'] = $existing_timestamps[$data['sensor_id']][$data['timestamp']];
$this->database->update('runtime_sensor', $data, 'id');