Skip to content

Commit f769261

Browse files
committed
Fixed pylint
1 parent e28bc77 commit f769261

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed

adafruit_bno055.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def use_external_crystal(self, value):
228228
def temperature(self):
229229
"""Measures the temperature of the chip in degrees Celsius."""
230230
return self._temperature
231-
231+
232232
@temperature.setter
233233
def temperature(self):
234234
self._temperature = _ReadOnlyUnaryStruct(0x34, 'b')
@@ -238,9 +238,8 @@ def acceleration(self):
238238
"""Gives the raw accelerometer readings, in m/s."""
239239
if self.mode not in [0, 2, 3, 6]:
240240
return self._acceleration
241-
else:
242-
return (None, None, None)
243-
241+
return (None, None, None)
242+
244243
@acceleration.setter
245244
def acceleration(self):
246245
self._acceleration = _ScaledReadOnlyStruct(0x08, '<hhh', 1/100)
@@ -251,9 +250,7 @@ def magnetic(self):
251250
"""Gives the raw magnetometer readings in microteslas."""
252251
if self.mode not in [0, 3, 5, 8]:
253252
return self._magnetic
254-
255-
else:
256-
return (None, None, None)
253+
return (None, None, None)
257254

258255
@magnetic.setter
259256
def magnetic(self):
@@ -265,9 +262,7 @@ def gyro(self):
265262
"""Gives the raw gyroscope reading in radians per second."""
266263
if self.mode not in [0, 1, 2, 4, 9, 10]:
267264
return self._gyro
268-
269-
else:
270-
return (None, None, None)
265+
return (None, None, None)
271266

272267
@gyro.setter
273268
def gyro(self):
@@ -278,10 +273,8 @@ def gyro(self):
278273
def euler(self):
279274
"""Gives the calculated orientation angles, in degrees."""
280275
if self.mode in [9, 11, 12]:
281-
282276
return self._euler
283-
else:
284-
return (None, None, None)
277+
return (None, None, None)
285278

286279
@euler.setter
287280
def euler(self):
@@ -293,22 +286,19 @@ def quaternion(self):
293286
"""Gives the calculated orientation as a quaternion."""
294287
if self.mode in [9, 11, 12]:
295288
return self._quaternion
296-
else:
297-
return (None, None, None, None)
289+
return (None, None, None, None)
298290

299291
@quaternion.setter
300292
def quaternion(self):
301-
self._quaternion = _ScaledReadOnlyStruct(0x20, '<hhhh', 1/(1<<14))
293+
self._quaternion = _ScaledReadOnlyStruct(0x20, '<hhhh', 1/(1<<14))
302294

303295

304296
@property
305297
def linear_acceleration(self):
306298
"""Returns the linear acceleration, without gravity, in m/s."""
307299
if self.mode in [9, 11, 12]:
308300
return self._linear_acceleration
309-
310-
else:
311-
return (None, None, None)
301+
return (None, None, None)
312302

313303
@linear_acceleration.setter
314304
def linear_acceleration(self):
@@ -320,10 +310,8 @@ def gravity(self):
320310
"""Returns the gravity vector, without acceleration in m/s."""
321311
if self.mode in [9, 11, 12]:
322312
return self._gravity
323-
324-
else:
325-
return (None, None, None)
313+
return (None, None, None)
326314

327315
@gravity.setter
328316
def gravity(self):
329-
self._gravity = _ScaledReadOnlyStruct(0x2e, '<hhh', 1/100)
317+
self._gravity = _ScaledReadOnlyStruct(0x2e, '<hhh', 1/100)

0 commit comments

Comments
 (0)