Author |
|
jpcurcio Senior Member
Joined: April 01 2007 Location: United States
Online Status: Offline Posts: 119
|
Posted: April 22 2007 at 22:02 | IP Logged
|
|
|
I want to check the status of a light; if it's off, I want to turn it on (to, say, 50%), else do nothing. So far, I have this:
if(ph_getinsteonlevel("L1")<1, ph_insteon("L1", ion, 127), 1)
Is this the best way to do (essentially) a NULL command for the "else"? Or is the some other "good programming practice" I should observe?
-JPC
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: April 22 2007 at 23:05 | IP Logged
|
|
|
Yup, that's fine.
|
Back to Top |
|
|
bhlonewolf Senior Member
Joined: March 29 2007
Online Status: Offline Posts: 198
|
Posted: April 22 2007 at 23:10 | IP Logged
|
|
|
I'm thinking this answers my question about turning off a light posted a little while ago. Thanks :)
|
Back to Top |
|
|
jpcurcio Senior Member
Joined: April 01 2007 Location: United States
Online Status: Offline Posts: 119
|
Posted: April 23 2007 at 00:17 | IP Logged
|
|
|
Thanks again, Tony.
|
Back to Top |
|
|