From: Denis Mx <dm...@ya...> - 2006-06-19 20:53:34
|
Interesting, David. This would bring up more questions then: why an assignment here? I have checked the Perl syntax at http://en.wikibooks.org/wiki/Programming:Perl_Operators and the comparison operator is indeed a double =. I still think that is the error in the code of the if statement. Larry should try if ($state == state_now $GarageDoorMonitor) instead of what he has. Cheers Denis --- David J Mark <st...@ci...> a écrit : > No that is not correct. The = is an assigment here. > > Thank you, > David J Mark > Ohio Media Group > > > -----Original Message----- > From: > mis...@li... > [mailto:mis...@li...]On > Behalf Of > Denis Mx > Sent: Monday, June 19, 2006 8:28 AM > To: The main list for the MisterHouse home > automation program > Subject: Re: [mh] Garage door > > > Check to make sure you should not use two = signs > for > comparison in Perl (I know C/C++ but in Perl I just > go > by intuition). > > $timer_garage_door = new Timer(); > > if ($state = state_now $GarageDoorMonitor $state) > { > > might be... > > if ($state == state_now $GarageDoorMonitor > $state) > { > > My guess is that you are assigning the present state > to your variable $state then checking if it is zero > or > not instead of comparing them to see if they are > equal > (judging from the C syntax) > > cheers > Denis > > --- David J Mark <st...@ci...> a écrit : > > > > > > > Thank you, > > David J Mark > > Ohio Media Group > > > > > > -----Original Message----- > > From: > mis...@li... > > > [mailto:mis...@li...]On > > Behalf Of Larry > > Moss > > Sent: Tuesday, January 10, 2006 3:29 PM > > To: mis...@li... > > Subject: [mh] (no subject) > > > > > > I sent this out yesterday and have not yet seen it > > appear on the list I > > apologize if you're seeing it for the second time. > > > > Hi, > > > > I just put a sensor on my garage door. Unlike > many > > of you, I don't have > > (or want) MH speaking to me. But we have a problem > > with the garage door > > being opened accidently. I figured I could just > > flash the lights when the > > door is left open. It almost works. What the > code > > should be doing is > > waiting 15 minutes. If the door is open that > long, > > I want to know. Then > > it should turn the lights either on or off > > (inverting their current state) > > and then returning them to the original state a > few > > seconds later. I'd > > really appreciate it if someone would tell me what > > I'm doing wrong. Or if > > someone can suggest a better approach, I'd love to > > know what it is. > > Thanks. > > > > $timer_garage_door = new Timer(); > > > > if ($state = state_now $GarageDoorMonitor $state) > { > > > > What is with the second $state? > > > > > > set $timer_garage_door ($state eq 'off') ? > 900 > > : 0; > > print_log "GarageDoorMonitor: " . $state; > > print_msg "garage door $state" if $state eq > > 'off' and > > inactive $timer_garage_door; > > > > You should change this to a display call > (print_msg > > is deprecated.) > > > > } > > > > if (expired $timer_garage_door and state > > $GarageDoorMonitor eq 'off') { > > print_log "garage door still open"; > > my $livingroomstateorig = state > > $livingroomtrack; > > set $livingroomtrack ('on' eq > > $livingroomstateorig) ? 'off' : 'on'; > > > > The next line is a problem. Change to: > > eval_with_timer "set > > \$livingroomtrack '$livingroomstateorig'", 3 > > > > eval_with_timer 'set $livingroomtrack > > $livingroomstateorig', 3; > > } > > > > Larry Moss, http://www.fooledya.com > > PO Box 23523, Rochester, NY 14692, (585) 359-8695 > > Magic, juggling, balloon art and other useless > > skills > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do > > you grep through log files > > for problems? Stop! Download the new AJAX search > > engine that makes > > searching your log files as easy as surfing the > > web. DOWNLOAD SPLUNK! > > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > > > ________________________________________________________ > > To unsubscribe from this list, go to: > > http://sourceforge.net/mail/?group_id=1365 > > > BEGIN:VCARD > > VERSION:2.1 > > N:Mark;David > > FN:David J Mark (E-mail) > > ORG:Ohio Media Group > > TEL;WORK;VOICE:513-652-2543 > > TEL;HOME;VOICE:513-652-2543 > > TEL;CELL;VOICE:513-652-2543 > > TEL;WORK;FAX:513-652-2543 > > ADR;WORK:;;6388 Wilderness Trail;West > > Chester;OH;45069;United States of America > > LABEL;WORK;ENCODING=QUOTED-PRINTABLE:6388 > Wilderness > > Trail=0D=0AWest Chester, OH 45069=0D=0AUnited > States > > of Amer= > > ica > > ADR;HOME:;;6388 Wilderness Trail;West > > Chester;OH;45069;United States of America > > LABEL;HOME;ENCODING=QUOTED-PRINTABLE:6388 > Wilderness > > Trail=0D=0AWest Chester, OH 45069=0D=0AUnited > States > > of Amer= > > ica > > EMAIL;PREF;INTERNET:dm...@ci... > > REV:20051130T204401Z > > END:VCARD > > > > > ________________________________________________________ > > To unsubscribe from this list, go to: > > http://sourceforge.net/mail/?group_id=1365 > > > > > > > > > > > > __________________________________________________________ > Lèche-vitrine ou lèche-écran ? > magasinage.yahoo.ca > > > ________________________________________________________ > To unsubscribe from this list, go to: > http://sourceforge.net/mail/?group_id=1365 > > BEGIN:VCARD > VERSION:2.1 > N:Mark;David > FN:David J Mark (E-mail) > ORG:Ohio Media Group > TEL;WORK;VOICE:513-652-2543 > TEL;HOME;VOICE:513-652-2543 > TEL;CELL;VOICE:513-652-2543 > TEL;WORK;FAX:513-652-2543 > ADR;WORK:;;6388 Wilderness Trail;West > Chester;OH;45069;United States of America > LABEL;WORK;ENCODING=QUOTED-PRINTABLE:6388 Wilderness > Trail=0D=0AWest Chester, OH 45069=0D=0AUnited States > of Amer= > ica > ADR;HOME:;;6388 Wilderness Trail;West > Chester;OH;45069;United States of America > LABEL;HOME;ENCODING=QUOTED-PRINTABLE:6388 Wilderness > Trail=0D=0AWest Chester, OH 45069=0D=0AUnited States > of Amer= > ica > EMAIL;PREF;INTERNET:dm...@ci... > REV:20051130T204401Z > END:VCARD > > > ________________________________________________________ > To unsubscribe from this list, go to: > http://sourceforge.net/mail/?group_id=1365 > > __________________________________________________________ Lèche-vitrine ou lèche-écran ? magasinage.yahoo.ca |