Bump leaone-ble to 0.2.0 (#143798)

* Bump leaone-ble to 0.2.0

changelog: https://github.com/Bluetooth-Devices/leaone-ble/compare/v0.1.0...v0.2.0

* update tests
This commit is contained in:
J. Nick Koston 2025-04-28 01:31:58 -05:00 committed by GitHub
parent 6a8722cf7c
commit 9ec174776c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 47 additions and 7 deletions

View File

@ -6,5 +6,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/leaone",
"iot_class": "local_push",
"requirements": ["leaone-ble==0.1.0"]
"requirements": ["leaone-ble==0.2.0"]
}

2
requirements_all.txt generated
View File

@ -1318,7 +1318,7 @@ lcn-frontend==0.2.4
ld2410-ble==0.1.1
# homeassistant.components.leaone
leaone-ble==0.1.0
leaone-ble==0.2.0
# homeassistant.components.led_ble
led-ble==1.1.7

View File

@ -1118,7 +1118,7 @@ lcn-frontend==0.2.4
ld2410-ble==0.1.1
# homeassistant.components.leaone
leaone-ble==0.1.0
leaone-ble==0.2.0
# homeassistant.components.led_ble
led-ble==1.1.7

View File

@ -1,8 +1,48 @@
"""Tests for the Leaone integration."""
from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo
from uuid import UUID
SCALE_SERVICE_INFO = BluetoothServiceInfo(
from bleak.backends.device import BLEDevice
from bluetooth_data_tools import monotonic_time_coarse
from homeassistant.components.bluetooth import BluetoothServiceInfoBleak
def make_bluetooth_service_info(
name: str,
manufacturer_data: dict[int, bytes],
service_uuids: list[str],
address: str,
rssi: int,
service_data: dict[UUID, bytes],
source: str,
tx_power: int = 0,
raw: bytes | None = None,
) -> BluetoothServiceInfoBleak:
"""Create a BluetoothServiceInfoBleak object for testing."""
return BluetoothServiceInfoBleak(
name=name,
manufacturer_data=manufacturer_data,
service_uuids=service_uuids,
address=address,
rssi=rssi,
service_data=service_data,
source=source,
device=BLEDevice(
name=name,
address=address,
details={},
rssi=rssi,
),
time=monotonic_time_coarse(),
advertisement=None,
connectable=True,
tx_power=tx_power,
raw=raw,
)
SCALE_SERVICE_INFO = make_bluetooth_service_info(
name="",
address="5F:5A:5C:52:D3:94",
rssi=-63,
@ -11,7 +51,7 @@ SCALE_SERVICE_INFO = BluetoothServiceInfo(
service_data={},
source="local",
)
SCALE_SERVICE_INFO_2 = BluetoothServiceInfo(
SCALE_SERVICE_INFO_2 = make_bluetooth_service_info(
name="",
address="5F:5A:5C:52:D3:94",
rssi=-63,
@ -23,7 +63,7 @@ SCALE_SERVICE_INFO_2 = BluetoothServiceInfo(
service_data={},
source="local",
)
SCALE_SERVICE_INFO_3 = BluetoothServiceInfo(
SCALE_SERVICE_INFO_3 = make_bluetooth_service_info(
name="",
address="5F:5A:5C:52:D3:94",
rssi=-63,