You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

23 lines
560 B

var isolat = (room, light, pir, lightCtl) => {
/* reg */
pir.forEach((item)=>{
item.on('peopleIn', ()=>{
if(!room.num){
light.on();
}
});
item.on('peopleOut', ()=>{
if(!room.num && room.LastActTime + lightCtl.NoPeopleDelayTime < new Date().valueOf()){
if(!pir.some((items)=>{
return items.state;
})){
light.off();
}
}
});
});
}
exports.isolat = isolat;