coffee/return
This commit is contained in:
@@ -21,7 +21,24 @@ gebId("ip_global").innerText = esp_conn_infos.ip_global
|
||||
gebId("ip_local").innerText = esp_conn_infos.ip_local
|
||||
gebId("valid_connection").innerText = esp_conn_infos.connection_valid
|
||||
gebId("last_seen").innerText = esp_conn_infos.last_seen
|
||||
|
||||
machienReady = gebId("machine-ready-butt")
|
||||
makeCoffee = gebId("make-coffee-butt")
|
||||
if(machine.status == "OFF"){
|
||||
gebId("machine-status").innerText = "AUS";
|
||||
gebId("machine-status-butt").classList.add("initBackRed");
|
||||
}
|
||||
if(machine.berror){
|
||||
gebId("machine-error-butt").classList.add("initBackRed");
|
||||
gebId("machiene-error-text").innerText = machine.error;
|
||||
}
|
||||
if(machine.ready && machine.state == "ON" && !machine.berror && esp_conn_infos.connection_valid){
|
||||
makeCoffee.classList.remove("deniePress");
|
||||
}
|
||||
if(machine.ready){
|
||||
machienReady.classList.remove("initBackRed");
|
||||
machienReady.classList.add("initBackGreen");
|
||||
gebId("machiene-ready-text").innerText = "Bereit";
|
||||
}
|
||||
if (esp_conn_infos.connection_valid) {
|
||||
gebId("validButt").classList.add("deniePress");
|
||||
gebId("machine-status-butt").classList.remove("deniePress");
|
||||
@@ -34,7 +51,33 @@ if (water.fill < 20) {
|
||||
if (beans.fill < 20) {
|
||||
gebId("beans-fill").parentElement.classList.add("blink-orange");
|
||||
}
|
||||
//all there given if generated html manipulations are not else-ed because the else condition is always in the dafult.
|
||||
//If later information is changed and should manipulate the html, it will come through socketio.js
|
||||
switch (machine.state) {
|
||||
case "ON":
|
||||
gebId("machine-status").innerText = "AN";
|
||||
gebId("machine-status-butt").classList.remove("blink-orange");
|
||||
gebId("machine-status-butt").classList.remove("initBackRed");
|
||||
gebId("machine-status-butt").classList.add("initBackGreen");
|
||||
break;
|
||||
case "PENDING":
|
||||
gebId("machine-status").innerText = "WARTEN";
|
||||
gebId("machine-status-butt").classList.add("blink-orange");
|
||||
gebId("machine-status-butt").classList.remove("initBackRed");
|
||||
gebId("machine-status-butt").classList.remove("initBackGreen");
|
||||
break;
|
||||
case "OFF":
|
||||
gebId("machine-status").innerText = "AUS";
|
||||
gebId("machine-status-butt").classList.remove("blink-orange");
|
||||
gebId("machine-status-butt").classList.add("initBackRed");
|
||||
gebId("machine-status-butt").classList.remove("initBackGreen");
|
||||
break;
|
||||
|
||||
default:
|
||||
gebId("machine-status").innerText = "UNBEKANNT";
|
||||
gebId("machine-status-butt").classList.add("initBackRed");
|
||||
}
|
||||
// All there
|
||||
function toggleMachine() {
|
||||
if (gebId("machine-status-butt").classList.contains("deniePress")){
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user