Compare commits

..

No commits in common. "14e9a4b9326cefee55b5321bfdca0a97602b05e1" and "1aa56bb8dd139cd946fb39be409ab61b2d26c421" have entirely different histories.

4 changed files with 2 additions and 52 deletions

1
.gitignore vendored
View File

@ -110,4 +110,3 @@ dist
# TernJS port file
.tern-port
package-lock.json

View File

@ -36,30 +36,6 @@ export class State {
communicator.send(config.mqtt.topics.auger, JSON.stringify(this.auger));
}
};
this.pof = {
on: false,
name: "pof",
topic: config.mqtt.topics.pof,
publisher: 'backend',
power: (communicator) => {
// This *should* toggle the state, asks if state is true, if it is set it false, otherwise set it true
this.pof.on ? this.pof.on = false : this.pof.on = true;
communicator.send(config.mqtt.topics.pof, JSON.stringify(this.pof));
}
};
this.vacuum = {
on: false,
name: "vacuum",
topic: config.mqtt.topics.vacuum,
publisher: 'backend',
power: (communicator) => {
// This *should* toggle the state, asks if state is true, if it is set it false, otherwise set it true
this.vacuum.on ? this.vacuum.on = false : this.vacuum.on = true;
communicator.send(config.mqtt.topics.vacuum, JSON.stringify(this.vacuum));
}
};
console.log(`State initialized.`)
};
};

View File

@ -7,18 +7,14 @@ const config = {
"topics": {
"igniter": "hestia/status/igniter",
"exhaust": "hestia/status/exhaust",
"auger": "hestia/status/auger",
"pof": "hestia/status/pof",
"vacuum": "hestia/status/vacuum"
"auger": "hestia/status/auger"
}
},
"states": {
"elements": [
"igniter",
"exhaust",
"auger",
"pof",
"vacuum"
"auger"
]
}
};
@ -29,8 +25,6 @@ export function refreshState(doc, state) {
const igniterStatus = doc.getElementById("igniter-status");
const exhaustStatus = doc.getElementById("exhaust-status");
const augerStatus = doc.getElementById("auger-status");
const pofStatus = doc.getElementById("pof-status");
const vacuumStatus = doc.getElementById("vacuum-status");
let statusString;
statusString = '';
@ -44,15 +38,6 @@ export function refreshState(doc, state) {
statusString = '';
if (state.auger.on) statusString = "On"; else statusString = "Off";
augerStatus.innerHTML = statusString;
statusString = '';
if (state.pof.on) statusString = "On"; else statusString = "Off";
pofStatus.innerHTML = statusString;
statusString = '';
if (state.vacuum.on) statusString = "On"; else statusString = "Off";
vacuumStatus.innerHTML = statusString;
console.log('State refreshed.');
}

View File

@ -43,16 +43,6 @@
<td class="py-2 px-4">Auger</td>
<td class="py-2 px-4" id="auger-status">Placeholder</td>
</tr>
<!-- PoF -->
<tr>
<td class="py-2 px-4">PoF</td>
<td class="py-2 px-4" id="pof-status">Placeholder</td>
</tr>
<!-- Vacuum -->
<tr>
<td class="py-2 px-4">Vacuum</td>
<td class="py-2 px-4" id="vacuum-status">Placeholder</td>
</tr>
</tbody>
</table>
<div class="button-container flex">