Refresh the complete row on all overview pages on changes, including the background color (closes #39)

This commit is contained in:
Bernd Bestel
2018-08-07 20:11:08 +02:00
parent 339d81318f
commit c4b0ef4d49
10 changed files with 176 additions and 49 deletions

View File

@@ -20,11 +20,13 @@ class BatteriesService extends BaseService
$battery = $this->Database->batteries($batteryId);
$batteryChargeCylcesCount = $this->Database->battery_charge_cycles()->where('battery_id', $batteryId)->count();
$batteryLastChargedTime = $this->Database->battery_charge_cycles()->where('battery_id', $batteryId)->max('tracked_time');
$nextChargeTime = $this->Database->batteries_current()->where('battery_id', $batteryId)->min('next_estimated_charge_time');
return array(
'battery' => $battery,
'last_charged' => $batteryLastChargedTime,
'charge_cycles_count' => $batteryChargeCylcesCount
'charge_cycles_count' => $batteryChargeCylcesCount,
'next_estimated_charge_time' => $nextChargeTime
);
}