From: Jim D. <ji...@du...> - 2011-06-10 00:01:43
|
On 06/09/2011 07:28 PM, Jim Duda wrote: > Karl, > > If your using the latest SVN, you should be able to do this: > > $decklights = new Owfs_DS2408 ( "29.484606000000", "Deck Lights", 0 ); # decklights > > $statenow = $decklights->get_sensed( ); > > This *should* return 1 or 0. If not, let me know and it's easily repaired. > See lib/Owfs_Item::Owfs_DS2408 package. Karl, I just tested Owfs_DS2408 and indeed found a problem, as you did yourself. I have committed a fix in SVN such that Owfs_DS2408::get_sensed( ) properly returns 1 or 0. You might find this object better for you needs as it might avoid some loop stalls. $decklights = new Owfs_DS2408 ( "29.484606000000", "Deck Lights", 0, $interval ); # decklights The $interval parameter in the constructor controls the "polling" loop of fetching data from OWFS. If you can tolerate a few seconds of delay, you can set $interval to 2 or 3, or whatever you need. Jim |