#11 Energieverbrauch näherungsweise berechnen

This commit is contained in:
David Zingg
2019-11-25 21:00:24 +01:00
parent d2e1b00b3f
commit 6b041d7cca
4 changed files with 19 additions and 4 deletions

View File

@ -8,6 +8,7 @@ $(function() {
self.onOffButtonEnabled = ko.observable();
self.mystromswitchPowerValue = document.getElementById("mystromswitchPowerValue")
self.mystromswitchEnergyValue = document.getElementById("mystromswitchEnergyValue")
self.onToggleRelayEvent = function(){
$.ajax({
@ -32,6 +33,7 @@ $(function() {
return;
}
self.onOffButtonEnabled(data.onOffButtonEnabled);
self.mystromswitchEnergyValue.innerHTML = "Energy: "+data.energy.toFixed(1)+"Wh"
if(data.relay == false){
self.mystromswitchPowerValue.innerHTML = "Relay is off";
} else if (data.power != null) {