From: 
Subject: Debian changes

The Debian packaging of airthings-ble is maintained in git, using a workflow
similar to the one described in dgit-maint-merge(7).
The Debian delta is represented by this one combined patch; there isn't a
patch queue that can be represented as a quilt series.

A detailed breakdown of the changes is available from their canonical
representation -- git commits in the packaging repository.
For example, to see the changes made by the Debian maintainer in the first
upload of upstream version 1.2.3, you could use:

    % git clone https://git.dgit.debian.org/airthings-ble
    % cd airthings-ble
    % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'

(If you have dgit, use `dgit clone airthings-ble`, rather than plain `git clone`.)

We don't use debian/source/options single-debian-patch because it has bugs.
Therefore, NMUs etc. may nevertheless have made additional patches.

---

diff --git a/airthings_ble/sensor_decoders.py b/airthings_ble/sensor_decoders.py
index 6885e7b..8dbeeea 100644
--- a/airthings_ble/sensor_decoders.py
+++ b/airthings_ble/sensor_decoders.py
@@ -214,25 +214,25 @@ SENSOR_DECODERS: dict[
     str,
     Callable[[bytearray], dict[str, float | None | str]],
 ] = {
-    str(CHAR_UUID_DATETIME): _decode_wave(name="date_time", format_type="H5B", scale=0),
+    str(CHAR_UUID_DATETIME): _decode_wave(name="date_time", format_type="<H5B", scale=0),
     str(CHAR_UUID_HUMIDITY): _decode_attr(
         name="humidity",
-        format_type="H",
+        format_type="<H",
         scale=1.0 / 100.0,
         max_value=PERCENTAGE_MAX,
     ),
     str(CHAR_UUID_RADON_1DAYAVG): _decode_attr(
-        name="radon_1day_avg", format_type="H", scale=1.0, max_value=RADON_MAX
+        name="radon_1day_avg", format_type="<H", scale=1.0, max_value=RADON_MAX
     ),
     str(CHAR_UUID_RADON_LONG_TERM_AVG): _decode_attr(
-        name="radon_longterm_avg", format_type="H", scale=1.0, max_value=RADON_MAX
+        name="radon_longterm_avg", format_type="<H", scale=1.0, max_value=RADON_MAX
     ),
     str(CHAR_UUID_ILLUMINANCE_ACCELEROMETER): _decode_wave_illum_accel(
-        name="illuminance_accelerometer", format_type="BB", scale=1.0
+        name="illuminance_accelerometer", format_type="<BB", scale=1.0
     ),
     str(CHAR_UUID_TEMPERATURE): _decode_attr(
         name="temperature",
-        format_type="h",
+        format_type="<h",
         scale=1.0 / 100.0,
         max_value=TEMPERATURE_MAX,
         min_value=TEMPERATURE_MIN,
diff --git a/tests/test_wave_gen_1.py b/tests/test_wave_gen_1.py
index 2da72ce..1068c2c 100644
--- a/tests/test_wave_gen_1.py
+++ b/tests/test_wave_gen_1.py
@@ -1,9 +1,12 @@
 import logging
+import struct
+from types import SimpleNamespace
 
 import pytest
-from airthings_ble import AirthingsBluetoothDeviceData
+from airthings_ble import AirthingsBluetoothDeviceData, sensor_decoders
 from airthings_ble.const import (
     CHAR_UUID_DATETIME,
+    CHAR_UUID_HUMIDITY,
     CHAR_UUID_RADON_1DAYAVG,
     CHAR_UUID_RADON_LONG_TERM_AVG,
     CHAR_UUID_TEMPERATURE,
@@ -19,6 +22,22 @@ from fakes import FakeClient, FakeService, ble_device, device_info_gatt, use_cli
 _LOGGER = logging.getLogger(__name__)
 
 
+@pytest.fixture(autouse=True, params=("<", ">"), ids=("little-endian", "big-endian"))
+def native_byte_order(
+    request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatch
+) -> None:
+    """Exercise the decoders with either native byte order on any host."""
+
+    def unpack(format_type: str, raw_data: bytearray) -> tuple[int, ...]:
+        if format_type[0] in "@=":
+            format_type = format_type[1:]
+        if format_type[0] not in "<>!":
+            format_type = request.param + format_type
+        return struct.unpack(format_type, raw_data)
+
+    monkeypatch.setattr(sensor_decoders, "struct", SimpleNamespace(unpack=unpack))
+
+
 def test_wave_gen_1_illuminance_and_accelerometer() -> None:
     """Test Wave Gen 1 illuminance and accelerometer."""
     raw_data = bytearray.fromhex("b20c")
@@ -30,6 +49,13 @@ def test_wave_gen_1_illuminance_and_accelerometer() -> None:
     assert decoded_data["illuminance"] == 69
 
 
+def test_wave_gen_1_humidity() -> None:
+    """Test Wave Gen 1 humidity is little-endian hundredths of a percent."""
+    decoded_data = SENSOR_DECODERS[str(CHAR_UUID_HUMIDITY)](bytearray.fromhex("8813"))
+
+    assert decoded_data == {"humidity": 50.0}
+
+
 @pytest.mark.parametrize(
     ("uuid", "key"),
     [
