Closed Lukino2000 closed 2 years ago
That's what I thought.
Your implementation is incorrect, but not much is missing.
When you instantiate your RPanel object, all of its devices are undefined until the connection is established and the configuration is retrieved.
Once this step is completed, your RPanel object will emit a 'SystemInitComplete' event to inform that the object is ready to operate.
So you have to define and call your 'GetPartitionState' function within this event:
RPanel.on('SystemInitComplete', () => {
let GetPartitionState = (() => {
if ((RPanel.Partitions.ById(1)).Arm) {
console.log('Partition is Armed State');
} else {
console.log('Partition is Disarmed State');
}
});
GetPartitionState();
});
For a LighSys with 50 zones, it takes about a minute to connect and read the configuration.
Hi @TJForc , you're right! now it works correctly, thanks
Hi,
I'm trying using "risco-lan-bridge" on LightSys with multisocket card but it gives me this "undefined error"
index.mjs content:
error message: