diff --git a/plugins/dynamix.apcupsd/UPSdetails.page b/plugins/dynamix.apcupsd/UPSdetails.page
index 92b9a3b6b..d15484997 100644
--- a/plugins/dynamix.apcupsd/UPSdetails.page
+++ b/plugins/dynamix.apcupsd/UPSdetails.page
@@ -22,7 +22,7 @@ function getUPSstatus() {
$('#ups_summary').html(data[0]);
$('#ups_status').html(data[1]);
}
-0 || ($display['refresh']<0 && $var['mdResync']==0))):?>
+
setTimeout(getUPSstatus,=max(abs($display['refresh']),15000)?>);
});
@@ -32,5 +32,5 @@ $(getUPSstatus);
| Key | Value | Key | Value |
-| Please wait, retrieving UPS information... |
+| Please wait, retrieving UPS information... |
diff --git a/plugins/dynamix.apcupsd/UPSsummary.page b/plugins/dynamix.apcupsd/UPSsummary.page
index e521122ba..b217cf6b2 100644
--- a/plugins/dynamix.apcupsd/UPSsummary.page
+++ b/plugins/dynamix.apcupsd/UPSsummary.page
@@ -23,7 +23,7 @@ table.ups tbody tr td{padding-left:10px;font-weight:bold;}
function getUPSstatus() {
$.get('/plugins/dynamix.apcupsd/include/UPSstatus.php',{all:'false'},function(data) {
if (data) $('#ups_summary').html(data);
-0 || ($display['refresh']<0 && $var['mdResync']==0))):?>
+
setTimeout(getUPSstatus, =max(abs($display['refresh']),15000)?>);
});
diff --git a/plugins/dynamix.apcupsd/include/UPSstatus.php b/plugins/dynamix.apcupsd/include/UPSstatus.php
index 1ed6c7b1e..b615a2bd3 100644
--- a/plugins/dynamix.apcupsd/include/UPSstatus.php
+++ b/plugins/dynamix.apcupsd/include/UPSstatus.php
@@ -26,7 +26,7 @@ $green = "class='green-text'";
$orange = "class='orange-text'";
$status = array_fill(0,6,"- | ");
$all = $_GET['all']=='true';
-$result = array();
+$result = [];
if (file_exists("/var/run/apcupsd.pid")) {
exec("/sbin/apcaccess 2>/dev/null", $rows);
@@ -62,7 +62,7 @@ if (file_exists("/var/run/apcupsd.pid")) {
if ($all && count($rows)%2==1) $result[] = " | | ";
if ($power && $load) $status[4] = ($load>=90 ? "" : " | ").intval($power*$load/100)." Watts | ";
}
-if ($all && !$rows) $result[] = "| No information available |
";
+if ($all && !$rows) $result[] = "| No information available |
";
echo "".implode('', $status)."
";
if ($all) echo "\n".implode('', $result);