Combine short byte strings in xiaomi_ble tests (#135268)

pull/134482/head
epenet 2025-01-10 10:19:28 +01:00 committed by GitHub
parent e29ead2a36
commit 04d5cc8f79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 12 deletions

View File

@ -52,7 +52,7 @@ async def test_event_button_press(hass: HomeAssistant) -> None:
hass,
make_advertisement(
mac,
b'XY\x97\td\xbc\x9c\xe3D\xefT" `' b"\x88\xfd\x00\x00\x00\x00:\x14\x8f\xb3",
b'XY\x97\td\xbc\x9c\xe3D\xefT" `\x88\xfd\x00\x00\x00\x00:\x14\x8f\xb3',
),
)
@ -78,7 +78,7 @@ async def test_event_unlock_outside_the_door(hass: HomeAssistant) -> None:
hass,
make_advertisement(
mac,
b"PD\x9e\x06C\x91\x8a\xebD\x1f\xd7\x0b\x00\t" b" \x02\x00\x01\x80|D/a",
b"PD\x9e\x06C\x91\x8a\xebD\x1f\xd7\x0b\x00\t \x02\x00\x01\x80|D/a",
),
)
@ -104,7 +104,7 @@ async def test_event_successful_fingerprint_match_the_door(hass: HomeAssistant)
hass,
make_advertisement(
mac,
b"PD\x9e\x06B\x91\x8a\xebD\x1f\xd7" b"\x06\x00\x05\xff\xff\xff\xff\x00",
b"PD\x9e\x06B\x91\x8a\xebD\x1f\xd7\x06\x00\x05\xff\xff\xff\xff\x00",
),
)
@ -153,7 +153,7 @@ async def test_event_dimmer_rotate(hass: HomeAssistant) -> None:
inject_bluetooth_service_info_bleak(
hass,
make_advertisement(
mac, b"X0\xb6\x036\x8b\x98\xc5A$\xf8\x8b\xb8\xf2f" b"\x13Q\x00\x00\x00\xd6"
mac, b"X0\xb6\x036\x8b\x98\xc5A$\xf8\x8b\xb8\xf2f\x13Q\x00\x00\x00\xd6"
),
)
@ -182,7 +182,7 @@ async def test_get_triggers_button(
hass,
make_advertisement(
mac,
b'XY\x97\td\xbc\x9c\xe3D\xefT" `' b"\x88\xfd\x00\x00\x00\x00:\x14\x8f\xb3",
b'XY\x97\td\xbc\x9c\xe3D\xefT" `\x88\xfd\x00\x00\x00\x00:\x14\x8f\xb3',
),
)
@ -406,7 +406,7 @@ async def test_if_fires_on_button_press(
hass,
make_advertisement(
mac,
b"XY\x97\tf\xbc\x9c\xe3D\xefT\x01" b"\x08\x12\x05\x00\x00\x00q^\xbe\x90",
b"XY\x97\tf\xbc\x9c\xe3D\xefT\x01\x08\x12\x05\x00\x00\x00q^\xbe\x90",
),
)
@ -442,7 +442,7 @@ async def test_if_fires_on_button_press(
hass,
make_advertisement(
mac,
b'XY\x97\td\xbc\x9c\xe3D\xefT" `' b"\x88\xfd\x00\x00\x00\x00:\x14\x8f\xb3",
b'XY\x97\td\xbc\x9c\xe3D\xefT" `\x88\xfd\x00\x00\x00\x00:\x14\x8f\xb3',
),
)
await hass.async_block_till_done()

View File

@ -23,8 +23,7 @@ from tests.components.bluetooth import (
"54:EF:44:E3:9C:BC",
make_advertisement(
"54:EF:44:E3:9C:BC",
b'XY\x97\td\xbc\x9c\xe3D\xefT" `'
b"\x88\xfd\x00\x00\x00\x00:\x14\x8f\xb3",
b'XY\x97\td\xbc\x9c\xe3D\xefT" `\x88\xfd\x00\x00\x00\x00:\x14\x8f\xb3',
),
"5b51a7c91cde6707c9ef18dfda143a58",
[
@ -114,7 +113,7 @@ from tests.components.bluetooth import (
"F8:24:41:C5:98:8B",
make_advertisement(
"F8:24:41:C5:98:8B",
b"X0\xb6\x036\x8b\x98\xc5A$\xf8\x8b\xb8\xf2f" b"\x13Q\x00\x00\x00\xd6",
b"X0\xb6\x036\x8b\x98\xc5A$\xf8\x8b\xb8\xf2f\x13Q\x00\x00\x00\xd6",
),
"b853075158487ca39a5b5ea9",
[
@ -221,7 +220,7 @@ async def test_xiaomi_fingerprint(hass: HomeAssistant) -> None:
hass,
make_advertisement(
"D7:1F:44:EB:8A:91",
b"PD\x9e\x06B\x91\x8a\xebD\x1f\xd7" b"\x06\x00\x05\xff\xff\xff\xff\x00",
b"PD\x9e\x06B\x91\x8a\xebD\x1f\xd7\x06\x00\x05\xff\xff\xff\xff\x00",
),
)
@ -264,7 +263,7 @@ async def test_xiaomi_lock(hass: HomeAssistant) -> None:
hass,
make_advertisement(
"D7:1F:44:EB:8A:91",
b"PD\x9e\x06C\x91\x8a\xebD\x1f\xd7\x0b\x00\t" b" \x02\x00\x01\x80|D/a",
b"PD\x9e\x06C\x91\x8a\xebD\x1f\xd7\x0b\x00\t \x02\x00\x01\x80|D/a",
),
)