Added "not found" messages for gyro/temp sensor.

This commit is contained in:
Magnus Persson
2022-08-02 13:02:01 +02:00
parent 414d7d51c2
commit a6bff7287e
4 changed files with 22 additions and 8 deletions

View File

@ -300,7 +300,11 @@
var angle = cfg["angle"];
if(angle==0) {
if(angle==-1) {
showError("Unable to connect to gyro, try a reset or power off/on")
$("#angle").text("No gyro");
$("#gravity").text("No gyro");
} else if(angle==0) {
$("#angle").text("Gyro moving");
$("#gravity").text("Gyro moving");
} else {
@ -329,10 +333,14 @@
$("#battery").text(batt + " V (" + charge + "%)" );
if( cfg["temp-format"] == "C")
$("#temp").text(cfg["temp-c"] + " C");
else
$("#temp").text(cfg["temp-f"] + " F");
if( cfg["temp-c"] == -273) {
$("#temp").text("No temp sensor");
} else {
if( cfg["temp-format"] == "C")
$("#temp").text(cfg["temp-c"] + " C");
else
$("#temp").text(cfg["temp-f"] + " F");
}
if( cfg["sleep-mode"] )
$("#sleep-mode").attr("checked", true );

File diff suppressed because one or more lines are too long