Bug#1103588: python-xiaomi-ble: autopktest failure on s390x: test_Xiaomi_MS1BB_MI_obj4a08 test_Xiaomi_HS1BB_illuminanca_and_motion test_Xiaomi_XMPIRO2SXS

Bastian Blank <[email protected]>
Newsgroups gmane.linux.debian.devel.bugs.rc,gmane.linux.debian.ports.s390
Message-ID <[email protected]>
On Sat, Apr 26, 2025 at 08:48:51AM +0200, Paul Gevers wrote:
> This bug has your user tag already, but it wasn't X-Debbugs-CC to you, you
> might want to help out. (Start of report below, full report from
> https://bugs.debian.org/1103588)

Something like:

--- a/src/xiaomi_ble/parser.py
+++ b/src/xiaomi_ble/parser.py
@@ -1171,7 +1171,7 @@
     xobj: bytes, device: XiaomiBluetoothDeviceData, device_type: str
 ) -> dict[str, Any]:
     """Motion detected with Illuminance in lux"""
-    (illum,) = struct.unpack("f", xobj)
+    (illum,) = struct.unpack("<f", xobj)
     device.update_predefined_binary_sensor(BinarySensorDeviceClass.MOTION, True)
     device.update_predefined_sensor(SensorLibrary.LIGHT__LIGHT_LUX, illum)
     return {}

Bastian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.