Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions MMM-Nest.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@
width: 0;
}

.MMM-Nest .thermContainer {
width: 120px;
}

.MMM-Nest .humidityText {
position:absolute;
font-size:large;
top: 60%;
width: 100%;
width: 120px;
text-align: center;
padding-top: 5px;
}

.MMM-Nest .nameText {
Expand Down Expand Up @@ -94,9 +99,6 @@
}

.MMM-Nest .humidityText {
top: 0;
display: block;
margin-top: 135px;
line-height: 1;
}

Expand Down Expand Up @@ -172,8 +174,8 @@
}

.MMM-Nest .greenBoth {
position: relative;
top: -124px;
position: absolute;
top: -5px;
left: -4px;
border: 4px solid #11d611;
border-radius: 50%;
Expand Down Expand Up @@ -210,8 +212,8 @@
}

.MMM-Nest .yellowBoth {
position: relative;
top: -124px;
position: absolute;
top: -5px;
left: -4px;
border: 4px solid #ffbe00;
border-radius: 50%;
Expand All @@ -238,8 +240,8 @@
}

.MMM-Nest .redBoth {
position: relative;
top: -124px;
position: absolute;
top: -5px;
left: -4px;
border: 4px solid #d92a00;
border-radius: 50%;
Expand Down
41 changes: 23 additions & 18 deletions MMM-Nest.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,35 +199,38 @@ Module.register("MMM-Nest",{
} else {
if (this.config.displayMode !== "protect" ) {
//var theName = document.createElement("div");
wrapper.className = "thermContainer";
var circle = document.createElement("div");
if (this.hvacMode[this.chosenNest] === 'heat-cool') {
wrapper.id = "circle";
wrapper.className = this.hvacState[this.chosenNest] + "HC";
wrapper.innerHTML = this.targetTempL[this.chosenNest] + " • " + this.targetTempH[this.chosenNest];
circle.id = "circle";
circle.className = this.hvacState[this.chosenNest] + "HC";
circle.innerHTML = this.targetTempL[this.chosenNest] + " • " + this.targetTempH[this.chosenNest];
} else {
wrapper.id = "circle";
wrapper.className = this.hvacState[this.chosenNest];
wrapper.innerHTML = this.targetTemp[this.chosenNest];
circle.id = "circle";
circle.className = this.hvacState[this.chosenNest];
circle.innerHTML = this.targetTemp[this.chosenNest];
}
var theTemp = document.createElement("div");
if (this.hvacState[this.chosenNest] === "cooling") {
theTemp.innerHTML = this.ambientTemp[this.chosenNest];
theTemp.className = "coolingText";
wrapper.appendChild(theTemp);
circle.appendChild(theTemp);
} else if ( this.hvacState === "heating") {
theTemp.innerHTML = this.ambientTemp[this.chosenNest];
theTemp.className = "heatingText";
wrapper.appendChild(theTemp);
circle.appendChild(theTemp);
} else if ( this.hvacMode !== 'heat-cool') {
if (parseInt(this.ambientTemp[this.chosenNest]) < parseInt(this.targetTemp[this.chosenNest])) {
theTemp.innerHTML = this.ambientTemp[this.chosenNest];
theTemp.className = "heatingText";
wrapper.appendChild(theTemp);
circle.appendChild(theTemp);
} else if (parseInt(this.ambientTemp[this.chosenNest]) > parseInt(this.targetTemp[this.chosenNest])) {
theTemp.innerHTML = this.ambientTemp[this.chosenNest];
theTemp.className = "coolingText";
wrapper.appendChild(theTemp);
circle.appendChild(theTemp);
}
}
wrapper.appendChild(circle);

var theHumidity = document.createElement("div");
theHumidity.innerHTML = this.humidity[this.chosenNest] + "%";
Expand All @@ -238,40 +241,42 @@ Module.register("MMM-Nest",{
var fan = document.createElement("img");
fan.src = this.file("icons/fan-icon.png");
fan.className = "fanIcon";
wrapper.appendChild(fan);
circle.appendChild(fan);
}
} if (this.config.displayMode === "both") {
var protectRing = document.createElement("div");
protectRing.className = this.uiColor[this.chosenProt] + "Both";
wrapper.appendChild(protectRing);

} if (this.config.displayMode === "protect") {
wrapper.id = "ring";
wrapper.className = this.uiColor[this.chosenProt] + "Ring";
var ring = document.createElement("div");
ring.id = "ring";
ring.className = this.uiColor[this.chosenProt] + "Ring";
if (this.uiColor[this.chosenProt] !== "green") {
var batteryIcon = document.createElement("img");
var displayText = document.createElement("p");
displayText.className = "alarmText";

if(this.coState[this.chosenProt] == "emergency") {
displayText.innerHTML = "CO";
wrapper.appendChild(displayText);
ring.appendChild(displayText);
} else if (this.smokeState[this.chosenProt] == "emergency") {
displayText.innerHTML = "Smoke";
wrapper.appendChild(displayText);
ring.appendChild(displayText);
} else if (this.coState[this.chosenProt] == "warning") {
displayText.innerHTML = "CO";
wrapper.appendChild(displayText);
ring.appendChild(displayText);
} else if (this.smokeState[this.chosenProt] == "warning") {
displayText.innerHTML = "Smoke";
wrapper.appendChild(displayText);
ring.appendChild(displayText);
} else if (this.batteryHealth[this.chosenProt] == "replace") {
batteryIcon.src = this.file("icons/battery-icon.png");
batteryIcon.className = "batteryIcon";
wrapper.appendChild(batteryIcon);
ring.appendChild(batteryIcon);
}
}

wrapper.appendChild(ring);
}
}

Expand Down