From: Bruce W. <br...@mi...> - 2002-04-10 03:27:59
|
> >Do you have an example of where it would be nice to do state_now the ECS > >way? > > for example, i have several events that kick off when i wake up > in the morning (testing 'scott is awake' with a state_now). i > also have MH set 'scott is awake' to true at 10am - just in > case i hadn't let MH know... i don't want the set of events to > occur again if i've already told MH i'm awake. i realize that i > could have this event at 10am check to make sure i'm not > already awake, but i'm just suggesting that as an example. it > becomes more useful when i've got tie_events associated with a > serial object that represents an X10 keypress. rather > than doing the test to see what state the object is at every time > i set a state, i can just set it and the events kicked off by > monitoring state_now won't get duplicated. > > i'm also open to the possibility that i've got ECS myopia... As David pointed out, it seems a modified state_now would dis-allow detecting sequential 'Volume up' type commands. Maybe we could add a state_changed method, which would be like state_now, but would return data only if the state really changed? Bruce |