• Bug#1103588: python-xiaomi-ble: autopktest failure on s390x: test_Xiaom

    From Chris Hofstaedtler@21:1/5 to All on Sat Apr 19 13:50:01 2025
    Source: python-xiaomi-ble
    Version: 0.36.0-1
    Severity: serious
    User: debian-s390@lists.debian.org
    Usertags: s390x

    python-xiaomi-ble autopktests fail on s390x:

    https://ci.debian.net/packages/p/python-xiaomi-ble/testing/s390x/59901553/

    39s =================================== FAILURES ===================================
    39s _________________________ test_Xiaomi_MS1BB_MI_obj4a08 _________________________
    39s
    39s def test_Xiaomi_MS1BB_MI_obj4a08():
    39s """Test Xiaomi parser for Linptech HS1BB(MI) motion + illuminance (4a08)."""
    39s data_string = b"HY\xeb*\xc2\xfc\xe0,\xa0\xb4:\xf28\x00\x00\xa2\xd9\xf0_"
    39s advertisement = bytes_to_service_info(data_string, address="A4:C1:38:05:8E:E9")
    39s bindkey = "7475a4a77584401780ffc3ee62dd353c"
    39s
    39s device = XiaomiBluetoothDeviceData(bindkey=bytes.fromhex(bindkey))
    39s assert device.supported(advertisement)
    39s assert device.bindkey_verified
    39s > assert device.update(advertisement) == SensorUpdate(
    39s title="Motion Sensor 8EE9 (HS1BB(MI))",
    39s devices={
    39s None: SensorDeviceInfo(
    39s name="Motion Sensor 8EE9",
    39s manufacturer="Xiaomi",
    39s model="HS1BB(MI)",
    39s hw_version=None,
    39s sw_version="Xiaomi (MiBeacon V5 encrypted)",
    39s )
    39s },
    39s entity_descriptions={
    39s KEY_ILLUMINANCE: SensorDescription(
    39s device_key=KEY_ILLUMINANCE,
    39s device_class=DeviceClass.ILLUMINANCE,
    39s native_unit_of_measurement=Units.LIGHT_LUX,
    39s ),
    39s KEY_SIGNAL_STRENGTH: SensorDescription(
    39s device_key=KEY_SIGNAL_STRENGTH,
    39s device_class=DeviceClass.SIGNAL_STRENGTH,
    39s native_unit_of_measurement="dBm",
    39s ),
    39s },
    39s entity_values={
    39s KEY_ILLUMINANCE: SensorValue(
    39s name="Illuminance", device_key=KEY_ILLUMINANCE, native_value=228
    39s ),
    39s KEY_SIGNAL_STRENGTH: SensorValue(
    39s name="Signal Strength", device_key=KEY_SIGNAL_STRENGTH, native_value=-60
    39s ),
    39s },
    39s binary_entity_descriptions={
    39s KEY_BINARY_MOTION: BinarySensorDescription(
    39s device_key=KEY_BINARY_MOTION,
    39s device_class=BinarySensorDeviceClass.MOTION,
    39s ),
    39s },
    39s binary_entity_values={
    39s KEY_BINARY_MOTION: BinarySensorValue(
    39s device_key=KEY_BINARY_MOTION, name="Motion", native_value=True
    39s ),
    39s },
    39s )
    39s E AssertionError: assert SensorUpdate(...)}, events={}) == SensorUpdate(...)}, events={})
    39s E
    39s E Omitting 6 identical items, use -vv to show
    39s E Differing attributes:
    39s E ['entity_values']
    39s E
    39s E Drill down into differing attribute entity_values:
    39s E entity_values: {DeviceKey(key='illuminance', device_id=None): SensorValue(device_key=DeviceKey(key='illuminance', device_id=None), name='Illuminance', native_value=3.596712768382508e-41), DeviceKey(key='signal_strength', device_id=None):
    SensorValue(device_key=DeviceKey(key='signal_strength', device_id=None), name='Signal Strength', native_value=-60)} != {DeviceKey(key='illuminance', device_id=None): SensorValue(device_key=DeviceKey(key='i...
    39s E
    39s E ...Full output truncated (32 lines hidden), use '-vv' to show
    39s
    39s tests/test_parser.py:2376: AssertionError
    39s ------------------------------ Captured log call -------------------------------
    39s DEBUG xiaomi_ble.parser:parser.py:1698 Parsing Xiaomi BLE advertisement data: <habluetooth.models.BluetoothServiceInfo object at 0x3ff9c4161a0>
    39s DEBUG xiaomi_ble.parser:parser.py:1698 Parsing Xiaomi BLE advertisement data: <habluetooth.models.BluetoothServiceInfo object at 0x3ff9c4161a0>
    39s ___________________ test_Xiaomi_HS1BB_illuminanca_and_motion ___________________
    39s
    39s def test_Xiaomi_HS1BB_illuminanca_and_motion():
    39s """Test Xiaomi parser for HS1BB illuminance and motion."""
    39s data_string = b"HY\xeb*\xc2\xfc\xe0,\xa0\xb4:\xf28\x00\x00\xa2\xd9\xf0_"
    39s advertisement = bytes_to_service_info(data_string, address="A4:C1:38:05:8E:E9")
    39s bindkey = "7475a4a77584401780ffc3ee62dd353c"
    39s
    39s device = XiaomiBluetoothDeviceData(bindkey=bytes.fromhex(bindkey))
    39s assert device.supported(advertisement)
    39s assert device.bindkey_verified
    39s > assert device.update(advertisement) == SensorUpdate(
    39s title="Motion Sensor 8EE9 (HS1BB(MI))",
    39s devices={
    39s None: SensorDeviceInfo(
    39s name="Motion Sensor 8EE9",
    39s manufacturer="Xiaomi",
    39s model="HS1BB(MI)",
    39s hw_version=None,
    39s sw_version="Xiaomi (MiBeacon V5 encrypted)",
    39s )
    39s },
    39s entity_descriptions={
    39s KEY_ILLUMINANCE: SensorDescription(
    39s device_key=KEY_ILLUMINANCE,
    39s device_class=DeviceClass.ILLUMINANCE,
    39s native_unit_of_measurement="lx",
    39s ),
    39s KEY_SIGNAL_STRENGTH: SensorDescription(
    39s device_key=KEY_SIGNAL_STRENGTH,
    39s device_class=DeviceClass.SIGNAL_STRENGTH,
    39s native_unit_of_measurement="dBm",
    39s ),
    39s },
    39s entity_values={
    39s KEY_ILLUMINANCE: SensorValue(
    39s name="Illuminance", device_key=KEY_ILLUMINANCE, native_value=228
    39s ),
    39s KEY_SIGNAL_STRENGTH: SensorValue(
    39s name="Signal Strength", device_key=KEY_SIGNAL_STRENGTH, native_value=-60
    39s ),
    39s },
    39s binary_entity_descriptions={
    39s KEY_BINARY_MOTION: BinarySensorDescription(
    39s device_key=KEY_BINARY_MOTION,
    39s device_class=BinarySensorDeviceClass.MOTION,
    39s ),
    39s },
    39s binary_entity_values={
    39s KEY_BINARY_MOTION: BinarySensorValue(
    39s device_key=KEY_BINARY_MOTION, name="Motion", native_value=True
    39s ),
    39s },
    39s )
    39s E AssertionError: assert SensorUpdate(...)}, events={}) == SensorUpdate(...)}, events={})
    39s E
    39s E Omitting 6 identical items, use -vv to show
    39s E Differing attributes:
    39s E ['entity_values']
    39s E
    39s E Drill down into differing attribute entity_values:
    39s E entity_values: {DeviceKey(key='illuminance', device_id=None): SensorValue(device_key=DeviceKey(key='illuminance', device_id=None), name='Illuminance', native_value=3.596712768382508e-41), DeviceKey(key='signal_strength', device_id=None):
    SensorValue(device_key=DeviceKey(key='signal_strength', device_id=None), name='Signal Strength', native_value=-60)} != {DeviceKey(key='illuminance', device_id=None): SensorValue(device_key=DeviceKey(key='i...
    39s E
    39s E ...Full output truncated (25 lines hidden), use '-vv' to show
    39s
    39s tests/test_parser.py:2896: AssertionError
    39s ------------------------------ Captured log call -------------------------------
    39s DEBUG xiaomi_ble.parser:parser.py:1698 Parsing Xiaomi BLE advertisement data: <habluetooth.models.BluetoothServiceInfo object at 0x3ff9c4f2200>
    39s DEBUG xiaomi_ble.parser:parser.py:1698 Parsing Xiaomi BLE advertisement data: <habluetooth.models.BluetoothServiceInfo object at 0x3ff9c4f2200>
    39s ____________________________ test_Xiaomi_XMPIRO2SXS ____________________________
    39s
    39s def test_Xiaomi_XMPIRO2SXS():
    39s """Test Xiaomi parser for Xiaomi Human Body Sensor 2S XMPIRO2SXS."""
    39s data_string = b"HY15\x0bdy\x91\x173\x1e\xf4\x02\x00\x00\xc5\xd2\xf6\xac"
    39s advertisement = bytes_to_service_info(data_string, address="DC:8E:95:2D:EA:43")
    39s bindkey = "685d647dc5e7bc9bcfcf5a1357bd2114"
    39s
    39s device = XiaomiBluetoothDeviceData(bindkey=bytes.fromhex(bindkey))
    39s assert device.supported(advertisement)
    39s assert device.bindkey_verified
    39s > assert device.update(advertisement) == SensorUpdate(
    39s title="Motion Sensor EA43 (XMPIRO2SXS)",
    39s devices={
    39s None: SensorDeviceInfo(
    39s name="Motion Sensor EA43",
    39s manufacturer="Xiaomi",
    39s model="XMPIRO2SXS",
    39s hw_version=None,
    39s sw_version="Xiaomi (MiBeacon V5 encrypted)",
    39s )
    39s },
    39s entity_descriptions={
    39s KEY_ILLUMINANCE: SensorDescription(
    39s device_key=KEY_ILLUMINANCE,
    39s device_class=DeviceClass.ILLUMINANCE,
    39s native_unit_of_measurement=Units.LIGHT_LUX,
    39s ),
    39s KEY_SIGNAL_STRENGTH: SensorDescription(
    39s device_key=KEY_SIGNAL_STRENGTH,
    39s device_class=DeviceClass.SIGNAL_STRENGTH,
    39s native_unit_of_measurement="dBm",
    39s ),
    39s },
    39s entity_values={
    39s KEY_ILLUMINANCE: SensorValue(
    39s name="Illuminance", device_key=KEY_ILLUMINANCE, native_value=51
    39s ),
    39s KEY_SIGNAL_STRENGTH: SensorValue(
    39s name="Signal Strength", device_key=KEY_SIGNAL_STRENGTH, native_value=-60
    39s ),
    39s },
    39s binary_entity_descriptions={
    39s KEY_BINARY_MOTION: BinarySensorDescription(
    39s device_key=KEY_BINARY_MOTION,
    39s device_class=BinarySensorDeviceClass.MOTION,
    39s ),
    39s },
    39s binary_entity_values={
    39s KEY_BINARY_MOTION: BinarySensorValue(
    39s device_key=KEY_BINARY_MOTION, name="Motion", native_value=True
    39s ),
    39s },
    39s )
    39s E AssertionError: assert SensorUpdate(...)}, events={}) == SensorUpdate(...)}, events={})
    39s E
    39s E Omitting 6 identical items, use -vv to show
    39s E Differing attributes:
    39s E ['entity_values']
    39s E
    39s E Drill down into differing attribute entity_values:
    39s E entity_values: {DeviceKey(key='illuminance', device_id=None): SensorValue(device_key=DeviceKey(key='illuminance', device_id=None), name='Illuminance', native_value=2.735614862054908e-41), DeviceKey(key='signal_strength', device_id=None):
    SensorValue(device_key=DeviceKey(key='signal_strength', device_id=None), name='Signal Strength', native_value=-60)} != {DeviceKey(key='illuminance', device_id=None): SensorValue(device_key=DeviceKey(key='i...
    39s E
    39s E ...Full output truncated (32 lines hidden), use '-vv' to show
    39s
    39s tests/test_parser.py:3054: AssertionError
    39s ------------------------------ Captured log call -------------------------------
    39s DEBUG xiaomi_ble.parser:parser.py:1698 Parsing Xiaomi BLE advertisement data: <habluetooth.models.BluetoothServiceInfo object at 0x3ff9c4fdfc0>
    39s DEBUG xiaomi_ble.parser:parser.py:1698 Parsing Xiaomi BLE advertisement data: <habluetooth.models.BluetoothServiceInfo object at 0x3ff9c4fdfc0>
    39s
    39s ---------- coverage: platform linux, python 3.13.2-final-0 -----------
    39s Name Stmts Miss Branch BrPart Cover Missing
    39s -------------------------------------------------------------------------------------------------
    39s /usr/lib/python3/dist-packages/xiaomi_ble/cloud.py 220 154 84 0 30% 78-79, 89-101, 104-115, 118-150, 153-162, 165-178, 181-185, 190-198, 201-203, 206-208, 213-248, 252, 259-263, 267-270, 274-275, 279-282, 286, 294-303, 309-317,
    330-344, 349, 354-356, 361-363, 372-374, 380-430, 435-452
    39s /usr/lib/python3/dist-packages/xiaomi_ble/parser.py 975 361 428 97 56% 51, 56, 65, 122->174, 126, 129-132, 135-148, 168->174, 184-191, 212-242, 255-281, 296, 302->310, 317->323, 319->323, 330->441, 341, 348->382, 352, 354, 357,
    363-378, 384, 395-410, 436, 448->460, 457-459, 468, 503-540, 554-555, 557-558, 560->563, 564-565, 569-570, 574-583, 606-607, 616, 625, 634, 647, 657, 666-707, 719->722, 729-731, 738->752, 759->770, 764, 767->770, 785->788, 795-801, 808-809, 816-823, 830-
    833, 848-860, 867-868, 878, 881-882, 897-901, 909-915, 922->926, 934-948, 964->976, 987-995, 998->1011, 1011->1019, 1045-1046, 1057-1065, 1097-1099, 1106->1118, 1113, 1136-1144, 1151-1159, 1166-1167, 1196-1201, 1208-1213, 1220-1229, 1239, 1240->1254,
    1262->1268, 1275-1283, 1290->1295, 1302->1305, 1320->1323, 1330-1331, 1338-1339, 1350, 1362-1369, 1375-1389, 1394->1400, 1407-1441, 1448-1482, 1489, 1496-1497, 1504, 1511-1520, 1527-1536, 1543-1552, 1628-1630, 1635-1637, 1685->1689, 1693, 1705->1700,
    1708->1700, 1710->1700, 1711->1700, 1717, 1749-1750, 1770-1774, 1778-1782, 1788-1789, 1793-1798, 1806-1813, 1840->1844, 1847-1850, 1854-1862, 1893-1897, 1919->1926, 1932->1946, 1941, 1952, 1978-1983, 1995, 2027-2032, 2039->2042, 2050-2051, 2059-2061,
    2087-2092, 2103-2104, 2112-2114, 2133-2138, 2140-2145, 2157-2165, 2171-2186
    39s -------------------------------------------------------------------------------------------------
    39s TOTAL 1269 515 514 97 53%
    39s
    39s 5 files skipped due to complete coverage.
    39s
    39s =========================== short test summary info ============================
    39s FAILED tests/test_parser.py::test_Xiaomi_MS1BB_MI_obj4a08 - AssertionError: a...
    39s FAILED tests/test_parser.py::test_Xiaomi_HS1BB_illuminanca_and_motion - Asser...
    39s FAILED tests/test_parser.py::test_Xiaomi_XMPIRO2SXS - AssertionError: assert ...
    39s ========================= 3 failed, 85 passed in 1.01s =========================
    39s E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest-lxc._sbnbwfk/downtmp/autopkgtest_tmp/build; python3.13 -m pytest tests
    39s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p 3.13 returned exit code 13
    39s make: *** [/tmp/86gzLaqGDt/run:4: pybuild-autopkgtest] Error 25

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bastian Blank@21:1/5 to Paul Gevers on Sat Apr 26 09:20:01 2025
    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

    --
    ... The prejudices people feel about each other disappear when they get
    to know each other.
    -- Kirk, "Elaan of Troyius", stardate 4372.5

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Debian Bug Tracking System@21:1/5 to All on Sat May 24 14:40:02 2025
    This is a multi-part message in MIME format...

    Your message dated Sat, 24 May 2025 12:35:56 +0000
    with message-id <E1uIo6W-00GueY-JN@fasolo.debian.org>
    and subject line Bug#1103588: fixed in python-xiaomi-ble 0.36.0-1.1
    has caused the Debian Bug report #1103588,
    regarding python-xiaomi-ble: autopktest failure on s390x: test_Xiaomi_MS1BB_MI_obj4a08 test_Xiaomi_HS1BB_illuminanca_and_motion test_Xiaomi_XMPIRO2SXS
    to be marked as done.

    This means that you claim that the problem has been dealt with.
    If this is not the case it is now your responsibility to reopen the
    Bug report if necessary, and/or fix the problem forthwith.

    (NB: If you are a system administrator and have no idea what this
    message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org
    immediately.)


    --
    1103588: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1103588
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    Received: (at submit) by bugs.debian.org; 19 Apr 2025 11:40:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
    (2021-04-09) on buxtehude.debian.org
    X-Spam-Level:
    X-Spam-Status: No, score=-1.8 required=4.0 tests=BAYES_00,DICTIONARYSEQ,
    FROMDEVELOPER,KHOP_HELO_FCRDNS,LONGWORD,MD5_SHA1_SUM,RCVD_IN_PBL,
    SPF_HELO_NONE,SPF_NONE,WEIRD_PORT,XMAILER_REPORTBUG autolearn=no
    autolearn_force=no version=3.4.6-bugs.debian.org_2005_01_02 X-Spam-Bayes: score:0.0000 Tokens: new, 288; hammy, 150; neutral, 242; spammy,
    0. spammytokens: hammytokens:0.000-+--python3, 0.000-+--autopkgtest,
    0.000-+--pybuild, 0.000-+--H*M:reportbug, 0.000-+--H*MI:reportbug Return-path: <zeha@debian.org>
    Received: from 069-002.static.dsl.fonira.net ([178.251.69.2]:44101 helo=tiksta.home.arpa)
    by buxtehude.debian.org with esmtp (Exim 4.94.2)
    (envelope-from <