From dace88d6a7e25bff625468e22c58b8f27fafc59e Mon Sep 17 00:00:00 2001 From: Elliott Balsley <3991046+llamafilm@users.noreply.github.com> Date: Sat, 8 Nov 2025 15:15:58 -0800 Subject: [PATCH] Make pack_service_data public This function can be used to create a `adafruit_ble.advertising.Advertisement` --- src/bthome.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/bthome.py b/src/bthome.py index db99d6c..b237243 100644 --- a/src/bthome.py +++ b/src/bthome.py @@ -94,7 +94,7 @@ class BTHome: HUMIDITY_UINT8_X1 = const(0x2E) # % MOISTURE_UINT8_X1 = const(0x2F) # % BUTTON_UINT8 = const(0x3A) # 01 = press, 02 = long press, etc. - DIMMER_UINT16 = const(0x03A) # 01xx = rotate left xx steps, 02xx = rotate right xx steps + DIMMER_UINT16 = const(0x03A) # 01xx = rotate left xx steps, 02xx = rotate right xx steps COUNT_UINT16_X1 = const(0x3D) COUNT_UINT32_X1 = const(0x3E) ROTATION_SINT16_X10 = const(0x3F) # ° @@ -458,11 +458,8 @@ def _pack_raw_text(self, object_id, value): # Concatenate an arbitrary number of sensor readings using parameters # of sensor data constants to indicate what's to be included. - def _pack_service_data(self, *args): - service_data_bytes = pack( - "B", BTHome._SERVICE_DATA_UUID16 - ) # indicates a 16-bit service UUID follows - service_data_bytes += pack("