From: Bruce W. <wi...@ch...> - 2005-03-24 01:37:46
|
>>When you said you used a remote to turn E10 on, was that done directly >>from remote -> module, or was mh involved? In order to unset the >>timer, mh would need to be the guy who set your light to ON. If mh was >>not the guy turning E10 ON, you could put in your own code to unset that >>timer when reading that incoming RF code. > > > I am using a W800RF32 to receive the RF commands. MH was the one who > turned the light on initially (from my user code in response to seeing > motion on a sensor). The part that I don't understand is how "self" > starts off as an RF object and turns into the actual switch object. Ok, I understand now. You want a set_with_timer event to be canceled if something outside of mh (e.g. your direct rf -> device command) sets that same device. I think we can do this by adding this test in lib/Serial_Item.pm sub set_receive function: return if &set_prev_pass_check($self, $state); # Override any set_by_timer requests if ($$self{timer}) { &Timer::unset($$self{timer}); delete $$self{timer}; } This is the same code that we use to cancel timers in the lib/Generic_Item.pm set method. The set_receive method is what is called when mh sees incoming serial data match one of its objects. Bruce |