Update byte string formatting (2) (#114039)
This commit is contained in:
parent
596ddbb6eb
commit
1dbc94162d
4 changed files with 19 additions and 19 deletions
|
@ -136,9 +136,9 @@ def valid_topic(topic: Any) -> str:
|
|||
)
|
||||
if "\0" in validated_topic:
|
||||
raise vol.Invalid("MQTT topic name/filter must not contain null character.")
|
||||
if any(char <= "\u001F" for char in validated_topic):
|
||||
if any(char <= "\u001f" for char in validated_topic):
|
||||
raise vol.Invalid("MQTT topic name/filter must not contain control characters.")
|
||||
if any("\u007f" <= char <= "\u009F" for char in validated_topic):
|
||||
if any("\u007f" <= char <= "\u009f" for char in validated_topic):
|
||||
raise vol.Invalid("MQTT topic name/filter must not contain control characters.")
|
||||
if any("\ufdd0" <= char <= "\ufdef" for char in validated_topic):
|
||||
raise vol.Invalid("MQTT topic name/filter must not contain non-characters.")
|
||||
|
|
|
@ -204,9 +204,9 @@ async def test_rfy_cover(hass: HomeAssistant, rfxtrx) -> None:
|
|||
)
|
||||
|
||||
assert rfxtrx.transport.send.mock_calls == [
|
||||
call(bytearray(b"\x0C\x1a\x00\x00\x01\x02\x03\x01\x00\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x01\x01\x02\x03\x01\x01\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x02\x01\x02\x03\x01\x03\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x00\x01\x02\x03\x01\x00\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x01\x01\x02\x03\x01\x01\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x02\x01\x02\x03\x01\x03\x00\x00\x00\x00")),
|
||||
]
|
||||
|
||||
# Test a blind with venetian mode set to US
|
||||
|
@ -257,12 +257,12 @@ async def test_rfy_cover(hass: HomeAssistant, rfxtrx) -> None:
|
|||
)
|
||||
|
||||
assert rfxtrx.transport.send.mock_calls == [
|
||||
call(bytearray(b"\x0C\x1a\x00\x00\x01\x02\x03\x02\x00\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x01\x01\x02\x03\x02\x0F\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x02\x01\x02\x03\x02\x10\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x03\x01\x02\x03\x02\x11\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x04\x01\x02\x03\x02\x12\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x00\x01\x02\x03\x02\x00\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x00\x01\x02\x03\x02\x00\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x01\x01\x02\x03\x02\x0f\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x02\x01\x02\x03\x02\x10\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x03\x01\x02\x03\x02\x11\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x04\x01\x02\x03\x02\x12\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x00\x01\x02\x03\x02\x00\x00\x00\x00\x00")),
|
||||
]
|
||||
|
||||
# Test a blind with venetian mode set to EU
|
||||
|
@ -313,10 +313,10 @@ async def test_rfy_cover(hass: HomeAssistant, rfxtrx) -> None:
|
|||
)
|
||||
|
||||
assert rfxtrx.transport.send.mock_calls == [
|
||||
call(bytearray(b"\x0C\x1a\x00\x00\x01\x02\x03\x03\x00\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x01\x01\x02\x03\x03\x11\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x02\x01\x02\x03\x03\x12\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x03\x01\x02\x03\x03\x0F\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x04\x01\x02\x03\x03\x10\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0C\x1a\x00\x00\x01\x02\x03\x03\x00\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x00\x01\x02\x03\x03\x00\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x01\x01\x02\x03\x03\x11\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x02\x01\x02\x03\x03\x12\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x03\x01\x02\x03\x03\x0f\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x04\x01\x02\x03\x03\x10\x00\x00\x00\x00")),
|
||||
call(bytearray(b"\x0c\x1a\x00\x00\x01\x02\x03\x03\x00\x00\x00\x00\x00")),
|
||||
]
|
||||
|
|
|
@ -54,7 +54,7 @@ async def test_application_state(
|
|||
"Home",
|
||||
"Amazon Video on Demand",
|
||||
"Free FrameChannel Service",
|
||||
"MLB.TV" + "\u00AE",
|
||||
"MLB.TV" + "\u00ae",
|
||||
"Mediafly",
|
||||
"Netflix",
|
||||
"Pandora",
|
||||
|
|
|
@ -522,7 +522,7 @@ async def test_if_fires_on_motion_detected(hass: HomeAssistant, calls) -> None:
|
|||
# Creates the device in the registry
|
||||
inject_bluetooth_service_info_bleak(
|
||||
hass,
|
||||
make_advertisement(mac, b"@0\xdd\x03$\x0A\x10\x01\x64"),
|
||||
make_advertisement(mac, b"@0\xdd\x03$\x0a\x10\x01\x64"),
|
||||
)
|
||||
|
||||
# wait for the device being created
|
||||
|
|
Loading…
Add table
Reference in a new issue