TJForc / risco-lan-bridge

risco-lan-bridge is a "bridge" between a node.js application and a Risco Panel
Other
21 stars 12 forks source link

Panel Type autodiscovery #7

Open vanackej opened 2 years ago

vanackej commented 2 years ago

Hi,

Currently, we are forced to instanciate the right panel type, and then a check is performed in RiscoComm#VerifyPanelType.

I've got the feeling we could detect the panel type using PNLCNF command, then instanciate the right Panel class automatically. That would be a lot easier for third party libraries integration.

What do you think about it ? Do you see any potential issues ? If it seems ok to you I can try to implement it and make a PR.

vanackej commented 2 years ago

Here is a PR for this : https://github.com/TJForc/risco-lan-bridge/pull/9 Fully tested on my Lightsys unit.