1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add support for scanners that do not provide connectable devices (#77132)

This commit is contained in:
J. Nick Koston
2022-08-22 08:02:26 -10:00
committed by GitHub
parent 61ff1b786b
commit 3938015c93
44 changed files with 1088 additions and 385 deletions

View File

@@ -14,7 +14,7 @@ from __future__ import annotations
# fmt: off
BLUETOOTH: list[dict[str, str | int | list[int]]] = {}
BLUETOOTH: list[dict[str, bool | str | int | list[int]]] = {}
""".strip()
@@ -36,7 +36,11 @@ def generate_and_validate(integrations: list[dict[str, str]]):
for entry in match_types:
match_list.append({"domain": domain, **entry})
return BASE.format(json.dumps(match_list, indent=4))
return BASE.format(
json.dumps(match_list, indent=4)
.replace('": true', '": True')
.replace('": false', '": False')
)
def validate(integrations: dict[str, Integration], config: Config):

View File

@@ -197,6 +197,7 @@ MANIFEST_SCHEMA = vol.Schema(
vol.Optional("bluetooth"): [
vol.Schema(
{
vol.Optional("connectable"): bool,
vol.Optional("service_uuid"): vol.All(str, verify_lowercase),
vol.Optional("service_data_uuid"): vol.All(str, verify_lowercase),
vol.Optional("local_name"): vol.All(str),