kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.95k stars 494 forks source link

Controllers version control and copy #1208

Open lalebarde opened 2 years ago

lalebarde commented 2 years ago

I have complex and big code Conditional Controllers. Some are in production and I need to make testing for new features without taking the risk to damage production.

I would like the following features:

  1. Copy controllers with same UUIDs for backup
  2. Copy controllers with new UUIDs for testing (change parameters, durations, etc): UUIDs would be changed in the code too
  3. Have an independent Git version control for each Conditional Controllers code

Alternatives (point to point):

  1. Existing backup feature but it is global
  2. Copy the code to external file, create a new Conditional Controller, declare the I/O, get the UUIDs, build a sed file for all UUIDs original vs new, paste the new code: long and inefficient
  3. Manage thje code in an external Git repository and copy/past as desired: long and inefficient

It would be nice to integrate such features.

kizniche commented 1 year ago

At the moment, the best way to preserve a particular configuration, including all controllers, is to perform a settings export. You can then import that settings file later and restore your system exactly how it was.

For large or complex code, I'd recommend creating a custom function module. This would allow you to use the UI dropdown to select Inputs/Outputs/Functions and not have to deal with UUIDs.

lalebarde commented 1 year ago

Hi Kyle, I don't catch it ("I'd recommend creating a custom function module. This would allow you to use the UI dropdown to select Inputs/Outputs/Functions and not have to deal with UUIDs"), could you elaborate please?