Skip to content

Commit 998e0f9

Browse files
committed
make it OK to call acceleration() if no accelerometer; fix return type
1 parent cd3f9a8 commit 998e0f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_pybadger/pybadger_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,12 @@ def light(self) -> bool:
439439
return self._light_sensor.value
440440

441441
@property
442-
def acceleration(self) -> Union[LSM6DS33, LIS3DH_I2C]:
442+
def acceleration(self) -> Tuple[int, int, int]:
443443
"""Accelerometer data, +/- 2G sensitivity."""
444444
return (
445445
self._accelerometer.acceleration
446446
if self._accelerometer is not None
447-
else None
447+
else (0, 0, 0)
448448
)
449449

450450
@property

0 commit comments

Comments
 (0)