From 04c7304a25b8b16c6cd31ac1caaac501f3fb57be Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Sun, 30 Jul 2023 14:53:48 +0200 Subject: [PATCH] pybricks.pupdevices: Fix TiltSensor not working. Fixes https://github.com/pybricks/support/issues/1189 --- CHANGELOG.md | 2 ++ pybricks/pupdevices/pb_type_pupdevices_tiltsensor.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c0d59c5..c939c8ead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,11 @@ ### Fixed - Improved external device detection speed ([support#1140]). +- Fixed Powered Up Tilt Sensor not working ([support#1189]). [support#1054]: https://github.com/pybricks/support/issues/1054 [support#1140]: https://github.com/pybricks/support/issues/1140 +[support#1189]: https://github.com/pybricks/support/issues/1189 ## [3.3.0b8] - 2023-07-07 diff --git a/pybricks/pupdevices/pb_type_pupdevices_tiltsensor.c b/pybricks/pupdevices/pb_type_pupdevices_tiltsensor.c index f68e0095c..dae7cb04f 100644 --- a/pybricks/pupdevices/pb_type_pupdevices_tiltsensor.c +++ b/pybricks/pupdevices/pb_type_pupdevices_tiltsensor.c @@ -24,7 +24,7 @@ STATIC mp_obj_t pupdevices_TiltSensor_make_new(const mp_obj_type_t *type, size_t PB_ARG_REQUIRED(port)); pupdevices_TiltSensor_obj_t *self = mp_obj_malloc(pupdevices_TiltSensor_obj_t, type); - pb_type_device_init_class(&self->device_base, port_in, PBDRV_LEGODEV_TYPE_ID_WEDO2_MOTION_SENSOR); + pb_type_device_init_class(&self->device_base, port_in, PBDRV_LEGODEV_TYPE_ID_WEDO2_TILT_SENSOR); return MP_OBJ_FROM_PTR(self); }