@@ -231,49 +231,63 @@ def temperature(self):
231
231
232
232
@property
233
233
def acceleration (self ):
234
- """Gives the raw accelerometer readings, in m/s."""
235
- if self .mode not in [0 , 2 , 3 , 6 ]:
234
+ """Gives the raw accelerometer readings, in m/s.
235
+ Returns an empty tuple of length 3 when this property has been disabled by the current mode.
236
+ """
237
+ if self .mode not in [0x00 , 0x02 , 0x03 , 0x06 ]:
236
238
return self ._acceleration
237
239
return (None , None , None )
238
240
239
241
@property
240
242
def magnetic (self ):
241
- """Gives the raw magnetometer readings in microteslas."""
242
- if self .mode not in [0 , 3 , 5 , 8 ]:
243
+ """Gives the raw magnetometer readings in microteslas.
244
+ Returns an empty tuple of length 3 when this property has been disabled by the current mode.
245
+ """
246
+ if self .mode not in [0x00 , 0x03 , 0x05 , 0x08 ]:
243
247
return self ._magnetic
244
248
return (None , None , None )
245
249
246
250
@property
247
251
def gyro (self ):
248
- """Gives the raw gyroscope reading in radians per second."""
249
- if self .mode not in [0 , 1 , 2 , 4 , 9 , 10 ]:
252
+ """Gives the raw gyroscope reading in radians per second.
253
+ Returns an empty tuple of length 3 when this property has been disabled by the current mode.
254
+ """
255
+ if self .mode not in [0x00 , 0x01 , 0x02 , 0x04 , 0x09 , 0x0a ]:
250
256
return self ._gyro
251
257
return (None , None , None )
252
258
253
259
@property
254
260
def euler (self ):
255
- """Gives the calculated orientation angles, in degrees."""
256
- if self .mode in [9 , 11 , 12 ]:
261
+ """Gives the calculated orientation angles, in degrees.
262
+ Returns an empty tuple of length 3 when this property has been disabled by the current mode.
263
+ """
264
+ if self .mode in [0x09 , 0x0b , 0x0c ]:
257
265
return self ._euler
258
266
return (None , None , None )
259
267
260
268
@property
261
269
def quaternion (self ):
262
- """Gives the calculated orientation as a quaternion."""
263
- if self .mode in [9 , 11 , 12 ]:
270
+ """Gives the calculated orientation as a quaternion.
271
+ Returns an empty tuple of length 3 when this property has been disabled by the current mode.
272
+ """
273
+ if self .mode in [0x09 , 0x0b , 0x0c ]:
264
274
return self ._quaternion
265
275
return (None , None , None , None )
266
276
267
277
@property
268
278
def linear_acceleration (self ):
269
- """Returns the linear acceleration, without gravity, in m/s."""
270
- if self .mode in [9 , 11 , 12 ]:
279
+ """Returns the linear acceleration, without gravity, in m/s.
280
+ Returns an empty tuple of length 3 when this property has been disabled by the current mode.
281
+ """
282
+ if self .mode in [0x09 , 0x0b , 0x0c ]:
271
283
return self ._linear_acceleration
272
284
return (None , None , None )
273
285
274
286
@property
275
287
def gravity (self ):
276
- """Returns the gravity vector, without acceleration in m/s."""
277
- if self .mode in [9 , 11 , 12 ]:
288
+ """Returns the gravity vector, without acceleration in m/s.
289
+ Returns an empty tuple of length 3 when this property has been disabled by the current mode.
290
+ """
291
+ if self .mode in [0x09 , 0x0b , 0x0c ]:
278
292
return self ._gravity
279
293
return (None , None , None )
0 commit comments