Jump to content

Else vs. a new program


Recommended Posts

Posted

I am working on a program with, as for now, several programs, the earlier of which call the next.

In at least one instance, the follow on program "could" just be added to the one before as an a ELSE path.

What are the considerations here?

 

Posted

Consistency of approach is one consideration. Else branch may work with state conditions, but rarely works as intended with events.

i usually have one, enabled program for events (commands received, times, etc.) and another, disabled program to check states (variables, light status, time or date ranges, etc.) and perform actions.

Posted

Thanks Goose. That is helpful. Part of what drove me to separate them was a debugging ability to disable the follow on. 

I do not mind more programs, appropriately linked.

 

Posted

Naming the programs with meaningful names is usually the key.

For programs I use for Alexa, mine are all named xxxxx.initiate. When I go to the ISY Portal and do a search, they are easily sorted from the rest and unlinked ones are easy to spot.

For the case of programs, as above, I usually suffix the sensing program with xxxx.trigger, or xxxx.sense.

Of course there are always exceptions and combination programs and it is a work of art trying to keep the names meaningful, but it usually pays in less confusion down the road when additions are wanted.

Guest
This topic is now closed to further replies.

×
×
  • Create New...