Best practice to add and develop plugins

I am new in HR and want to play a little bit with plugins (=scripts?).

I understand the structure of a plugin and I’ve learned that I can create a device by clicking “Device -> Add Plugin -> Import from file”
. Now a device is created and in the script folder my source code is shown.

What is the best practice when I want to modify my code? Delete my device and plugin and reload it again?

The file in the Scripts folder is editable. You do not have to delete it & reimport. It’ll be easier to just edit the existing file.

Hi Bill. Thank you for the answer. I already saw that is editable. But how do I then “execute” the plugin e.g. if I have added some additional attriebutes. By clicking “sychronize devices”?
In my case if modified the function onConnect():

{
var device = plugin.Devices[“1”];
device.Var1=1;
device.Var2=299;
device.Var3=1;
device.Var4=1;
console.log(“connected”);

}

by adding Var4, but I did no see any changes…

Yes, “Synchronize Devices” will add them. Or you can manually add them to the Attributes in the Properties pane.

now it is working! Thank you for your support!