[tuxdroid-svn] r407 - api/python/trunk
Status: Beta
Brought to you by:
ks156
From: remi <c2m...@c2...> - 2007-06-21 12:49:41
|
Author: remi Date: 2007-06-21 14:49:07 +0200 (Thu, 21 Jun 2007) New Revision: 407 Modified: api/python/trunk/tuxapi_class.py Log: UPD Verification of tux daemon connection before getting a status. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-06-19 16:43:49 UTC (rev 406) +++ api/python/trunk/tuxapi_class.py 2007-06-21 12:49:07 UTC (rev 407) @@ -315,8 +315,6 @@ # data type response if ord(data[2])==DATA_TP_RSP: if ord(data[3])==SUBDATA_TP_STATUS: - if self.event.on_status!=None: - self.event.on_status(data) #Head button if ord(data[4])==DATAS_STATUS_HEAD_PUSH_SWITCH: if ord(data[5])==1: @@ -443,6 +441,9 @@ if ord(data[5])==0: if self.event.on_spin_stop!=None: self.event.on_spin_stop() + #on status + if self.event.on_status!=None: + self.event.on_status(data) #-------------------------------------------------------------------------- @@ -2606,6 +2607,8 @@ """ Not a user function """ + if not self.parent.daemon.connected: + return 0 frame = self.get(DATA_STATUS) try: if len(frame) > 0: @@ -3079,6 +3082,8 @@ Example: >>> var = tux.status.light_level() """ + if not self.parent.daemon.connected: + return 0 frame = self.get(DATAS_STATUS_LIGHT_LEVEL) try: if len(frame) > 0: |