From: Gregg L. <gr...@li...> - 2008-09-13 02:24:51
|
John R. wrote: > Gregg Liming wrote: >> the existing "motion" synonyms are "on" and "alert" >> the existing "still" synonyms are "off" and "normal" > > I now have this: > > $machine_sensor = new Serial_Item('AMH', 'motion', 'weeder'); # M > $machine_sensor -> add ('AML', 'still'); > $machine_sensor -> add ('ARM', 'read'); > $machine_sensor -> add ('ASM', 'init'); > > $machine_sensor_motion_item = new Motion_Item($machine_sensor); > > $equipment->add($machine_sensor_motion_item); ^^^^^^^^^^ what item is this? Can you share it's definition? > It does not work. I tried the synonyms also. What specific tests (please elaborate all steps) did you take to determine "does not work"? > States appear to be working because this functions as expected: > > $equipment->set(ON) if state_now $machine_sensor eq 'motion'; > $equipment->set(OFF) if state_now $machine_sensor eq 'still'; Well.... since you didn't share what $equipment is, then I'm only left to guess. One thing that is pretty obvious is that it accepts ON and OFF as states. And, as I'm sure you diligently read the header comments in Motion_Item, Motion_Item instances only output "motion", "still" and "check". So, unless $equipment is an instance of something that understands those states, then ... If it does, then I'm assuming you realize that the next step is to provide a proper debug log. Gregg |