Skip to content

Commit

Permalink
Enhanced display of temperatures in case of fbdect-connection got lost
Browse files Browse the repository at this point in the history
  • Loading branch information
bombcheck committed Jan 6, 2018
1 parent 31bb871 commit 2673051
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/fbswitch_1.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
var DevicesTemp = response.split('|');
var IndoorTemp = "";
var OutdoorTemp = "";
var ShowTemp = false;

if (DevicesTemp.length > 0) {
for (tIndex = 0; tIndex < DevicesTemp.length; ++tIndex) {
Expand All @@ -220,12 +221,14 @@
IndoorTemp = parseInt(tempvar[1]) / 10;
if (IndoorTemp == -100) IndoorTemp = '---';
else IndoorTemp = IndoorTemp.toFixed(1) + ' °C';
ShowTemp = true;
}

if (tempvar[0] == <?php echo $OutdoorTempSource; ?>) {
OutdoorTemp = parseInt(tempvar[1]) / 10;
if (OutdoorTemp == -100) OutdoorTemp = '---';
else OutdoorTemp = OutdoorTemp.toFixed(1) + ' °C';
ShowTemp = true;
}
}
if (IndoorTemp == "") IndoorTemp = '---';
Expand Down Expand Up @@ -256,7 +259,8 @@
// var OutdoorTemp = '---';
// }

if (IndoorTemp != '---' || OutdoorTemp != '---') {
//if (IndoorTemp != '---' || OutdoorTemp != '---') {
if (ShowTemp == true) {
$('#tempmsg_favs').fadeIn('fast');
$('#tempmsg_devs').fadeIn('fast');
$('#tempmsg_groups').fadeIn('fast');
Expand Down

0 comments on commit 2673051

Please sign in to comment.