@@ -118,17 +118,17 @@ def __init__(self):
118118 :type: Event """
119119
120120 self .left_hand_lost = EteeControllerEvent ()
121- """Event for losing left controller connection. Occurs when data is not received for more than 0 .5 seconds.
121+ """Event for losing left controller connection. Occurs when data is not received for more than 1 .5 seconds.
122122
123123 :type: Event """
124124
125125 self .right_hand_lost = EteeControllerEvent ()
126- """Event for losing right controller connection. Occurs when data is not received for more than 0 .5 seconds.
126+ """Event for losing right controller connection. Occurs when data is not received for more than 1 .5 seconds.
127127
128128 :type: Event """
129129
130130 self .data_lost = EteeControllerEvent ()
131- """Event for losing data from both controllers. Occurs when data is not received for more than 0 .5 seconds.
131+ """Event for losing data from both controllers. Occurs when data is not received for more than 1 .5 seconds.
132132
133133 :type: Event """
134134
@@ -256,7 +256,6 @@ def _api_data_callback(self, frameno, data):
256256 :param dict data: Dictionary of the parsed controller data.
257257 """
258258 if data ["hand" ] == 0 :
259- # print(time.time() - self.hand_last_on_left)
260259 self ._api_data_left = data
261260 self ._hand_last_on_left = time .time ()
262261 self ._frameno_left += 1
@@ -272,10 +271,10 @@ def _api_data_callback(self, frameno, data):
272271
273272 self .hand_received .emit ()
274273
275- if time .time () - self ._hand_last_on_left > 0.1 and self ._api_data_left is not None :
274+ if ( time .time () - self ._hand_last_on_left ) > 1.5 and self ._api_data_left is not None :
276275 self ._api_data_left = None
277276 self .left_hand_lost .emit ()
278- if time .time () - self ._hand_last_on_right > 0.1 and self ._api_data_left is not None :
277+ if ( time .time () - self ._hand_last_on_right ) > 1.5 and self ._api_data_right is not None :
279278 self ._api_data_right = None
280279 self .right_hand_lost .emit ()
281280
@@ -314,8 +313,8 @@ def _rest_callback(self, reading):
314313 """
315314 if reading is not None :
316315 return
317- left_lost = time .time () - self ._hand_last_on_left > 0.1 and self ._api_data_left is not None
318- right_lost = time .time () - self ._hand_last_on_right > 0.1 and self ._api_data_right is not None
316+ left_lost = ( time .time () - self ._hand_last_on_left ) > 1.5 and self ._api_data_left is not None
317+ right_lost = ( time .time () - self ._hand_last_on_right ) > 1.5 and self ._api_data_right is not None
319318 if left_lost :
320319 self ._api_data_left = None
321320 self .left_hand_lost .emit ()
@@ -531,7 +530,7 @@ def all_hands_on(self):
531530 :return: Returns true if data has been recently received from both controllers.
532531 :rtype: bool
533532 """
534- return (self .get_left is not None ) and (self .get_right is not None )
533+ return (self ._api_data_left is not None ) and (self ._api_data_right is not None )
535534
536535 def any_hand_on (self ):
537536 """
0 commit comments