From: R P <ne...@ya...> - 2002-10-02 05:39:58
|
Bill, Here's the code file in question. (I would attach the .pl, but I don't think attachments would go through) Any suggestions/corrections would be appreciated! :^) -Ryan #----------------------------------- # Module to control the lights in the living room and dining room #----------------------------------- $timer_liv_motion = new Timer(); $signs_of_life = new Timer(); #if (expired $timer_liv_motion) { # set $liv_flrlamp 'off'; # set $dining_hang 'off'; # print_log "Motion Timer expired in living room, killing lights"; #} if ((state_now $liv_sensor eq 'motion') and $Dark) { set $liv_flrlamp '30%' if ((state $liv_flrlamp) eq 'off'); set $dining_hang '30%' if ((state $dining_hang) eq 'off'); set $timer_liv_motion 240; print_log "Motion detected in liv, Setting timer"; } $liv_sensor -> tie_event('set $signs_of_life 600'); #10 minutes if ((time_greater_than('12:00 AM')) and (expired $signs_of_life)) { print_log "No signs of life, and after midnight, killing lights"; set $dining_hang 'off'; set $liv_flrlamp 'off'; } if (time_now eq "$Time_Sunset - 0:30") { print_log "Getting Dark....."; set $liv_flrlamp '30%' if (state $liv_flrlamp eq 'off'); set $dining_hang '30%' if (state $dining_hang eq 'off'); } if (time_now eq "$Time_Sunset + 0:30") { print_log "Should be dark, cranking lights up further"; set $liv_flrlamp '60%' if (level $liv_flrlamp eq '50%'); set $dining_hang '60%' if (level $dining_hang eq '50%'); } __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com |