Fixed Bug #2
This commit is contained in:
parent
279c9e74be
commit
d5a9e4781c
|
@ -64,7 +64,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Text unter Table
|
||||
<button onclick="buttonDeleteJobById('all')">{{ translater.getTranslation("delete all jobs")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ class Translater:
|
|||
"planed duration": "geplante Dauer",
|
||||
"cancel": "abbrechen",
|
||||
"delete": "löschen",
|
||||
"delete all jobs" : "alle Aufträge löschen",
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -108,8 +108,12 @@ class Webserver:
|
|||
self.zoneManager.deleteIrrigationJobsForZone(zone)
|
||||
return "True"
|
||||
case "delete_job_by_id":
|
||||
if(index_str == "all"):
|
||||
self.zoneManager.clearIrrigationJobs()
|
||||
return "True"
|
||||
if (index):
|
||||
self.zoneManager.deleteIrrigationJobByID(index)
|
||||
return "True"
|
||||
case "get_dashboard_zone_html":
|
||||
if (index):
|
||||
zone = self.zoneManager.getZone(index)
|
||||
|
|
|
@ -15,13 +15,17 @@ function refreshZone(zone_json) {
|
|||
document.getElementById("desired_humidity_zone_" + zone.number).innerHTML = zone.desiredHumidity;
|
||||
}
|
||||
|
||||
function buttonDeleteJobById(jobId) {
|
||||
deleteJobById('delete_job_by_id',jobId);
|
||||
var jobToDelete = document.getElementById("job_" + jobId);
|
||||
document.getElementById("jobListBody").removeChild(jobToDelete);
|
||||
}
|
||||
|
||||
function refreshPipeline(pipeline_html) {
|
||||
document.getElementById("jobListBody").innerHTML = pipeline_html;
|
||||
}
|
||||
|
||||
function buttonDeleteJobById(jobId) {
|
||||
deleteJobById('delete_job_by_id',jobId);
|
||||
if(jobId == "all") {
|
||||
document.getElementById("jobListBody").innerHTML = "";
|
||||
} else {
|
||||
var jobToDelete = document.getElementById("job_" + jobId);
|
||||
document.getElementById("jobListBody").removeChild(jobToDelete);
|
||||
}
|
||||
}
|
10
Zone.py
10
Zone.py
|
@ -45,6 +45,9 @@ class Zone:
|
|||
self.zoneManager.switchZoneState(zone=self, state=True, duration=self.zoneManager.systemSettings.defaultAutoIrrigationDuration, instant=False)
|
||||
case 1:
|
||||
if(self.timeOver()):
|
||||
if (self.planedDuration > 0):
|
||||
self.setState = 3
|
||||
else:
|
||||
self.setState = 0
|
||||
self.refreshStateAutomode()
|
||||
else:
|
||||
|
@ -70,6 +73,9 @@ class Zone:
|
|||
self.setState = 3
|
||||
case 1:
|
||||
if(self.timeOver()):
|
||||
if (self.planedDuration > 0):
|
||||
self.setState = 3
|
||||
else:
|
||||
self.setState = 0
|
||||
self.state = False
|
||||
case 2:
|
||||
|
@ -105,7 +111,9 @@ class Zone:
|
|||
self.setState = 2
|
||||
self.endTimeSetState = time.time() + duration
|
||||
else:
|
||||
if(state):
|
||||
if(self.setState == 1):
|
||||
pass
|
||||
elif(state):
|
||||
self.setState = 3
|
||||
self.refreshState()
|
||||
|
||||
|
|
|
@ -60,6 +60,10 @@ class ZoneManager:
|
|||
else:
|
||||
i = i + 1
|
||||
|
||||
def clearIrrigationJobs(self):
|
||||
with self.piplineMutexLock:
|
||||
self.pipeLine = []
|
||||
|
||||
def isAnyZoneBusy(self):
|
||||
for zone in self.zones:
|
||||
if(zone.state):
|
||||
|
|
Loading…
Reference in New Issue