Allow [##:##:##:##:##] type device address in homeworks (#122872)

* Allow [##:##:##:##:##] type device address in homeworks

* Simplify regex
This commit is contained in:
Erik Montnemery 2024-07-31 08:02:15 +02:00 committed by GitHub
parent 823910b69e
commit 6d8bc84db3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -89,7 +89,7 @@ BUTTON_EDIT: VolDictType = {
}
validate_addr = cv.matches_regex(r"\[(?:\d\d:)?\d\d:\d\d:\d\d\]")
validate_addr = cv.matches_regex(r"\[(?:\d\d:){2,4}\d\d\]")
async def validate_add_controller(

View File

@ -436,7 +436,14 @@ async def test_options_add_remove_light_flow(
)
@pytest.mark.parametrize("keypad_address", ["[02:08:03:01]", "[02:08:03]"])
@pytest.mark.parametrize(
"keypad_address",
[
"[02:08:03]",
"[02:08:03:01]",
"[02:08:03:01:00]",
],
)
async def test_options_add_remove_keypad_flow(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,