Reset when elec power lost
This commit is contained in:
parent
0d95b0e766
commit
1f02d485f1
1 changed files with 7 additions and 0 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Reference in a new issue