Skip to content

Commit

Permalink
Bump habluetooth to 2.0.2 (#107097)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored and frenck committed Jan 5, 2024
1 parent d600b76 commit a7aa5c0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/bluetooth/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"bluetooth-auto-recovery==1.2.3",
"bluetooth-data-tools==1.19.0",
"dbus-fast==2.21.0",
"habluetooth==2.0.1"
"habluetooth==2.0.2"
]
}
2 changes: 1 addition & 1 deletion homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dbus-fast==2.21.0
fnv-hash-fast==0.5.0
ha-av==10.1.1
ha-ffmpeg==3.1.0
habluetooth==2.0.1
habluetooth==2.0.2
hass-nabucasa==0.75.1
hassil==1.5.1
home-assistant-bluetooth==1.11.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ ha-philipsjs==3.1.1
habitipy==0.2.0

# homeassistant.components.bluetooth
habluetooth==2.0.1
habluetooth==2.0.2

# homeassistant.components.cloud
hass-nabucasa==0.75.1
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ ha-philipsjs==3.1.1
habitipy==0.2.0

# homeassistant.components.bluetooth
habluetooth==2.0.1
habluetooth==2.0.2

# homeassistant.components.cloud
hass-nabucasa==0.75.1
Expand Down
32 changes: 32 additions & 0 deletions tests/components/bluetooth/test_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,38 @@ async def connect(self, *args, **kwargs):
cancel_hci1()


async def test_passing_subclassed_str_as_address(
hass: HomeAssistant,
two_adapters: None,
enable_bluetooth: None,
install_bleak_catcher,
) -> None:
"""Ensure the client wrapper can handle a subclassed str as the address."""
_, cancel_hci0, cancel_hci1 = _generate_scanners_with_fake_devices(hass)

class SubclassedStr(str):
pass

address = SubclassedStr("00:00:00:00:00:01")
client = bleak.BleakClient(address)

class FakeBleakClient(BaseFakeBleakClient):
"""Fake bleak client."""

async def connect(self, *args, **kwargs):
"""Connect."""
return True

with patch(
"habluetooth.wrappers.get_platform_client_backend_type",
return_value=FakeBleakClient,
):
assert await client.connect() is True

cancel_hci0()
cancel_hci1()


async def test_raise_after_shutdown(
hass: HomeAssistant,
two_adapters: None,
Expand Down

0 comments on commit a7aa5c0

Please sign in to comment.