Reset when elec power lost

This commit is contained in:
Jonathan Redpath 2018-12-29 17:41:26 +00:00
parent 0d95b0e766
commit 1f02d485f1

View file

@ -133,6 +133,7 @@ var status = {
var ECAM_controller = {
init: func() {
ECAMloopTimer.start();
me.reset();
},
loop: func() {
# check active messages
@ -220,6 +221,12 @@ var ECAM_controller = {
},
};
setlistener("/systems/electrical/bus/ac-ess", func {
if (getprop("/systems/electrical/bus/ac-ess") < 110) {
ECAM_controller.reset();
}
}, 0, 0);
var ECAMloopTimer = maketimer(0.2, func {
ECAM_controller.loop();
});