1
mirror of https://github.com/home-assistant/supervisor synced 2024-08-05 03:49:58 +02:00

Add matter discovery (#4002)

This commit is contained in:
Martin Hjelmare 2022-11-15 15:07:56 +01:00 committed by GitHub
parent 4afbedfa3d
commit 348fb56cb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,13 @@
"""Discovery service for Matter Server."""
import voluptuous as vol
from ...validate import network_port
from ..const import ATTR_HOST, ATTR_PORT
# pylint: disable=no-value-for-parameter
SCHEMA = vol.Schema(
{
vol.Required(ATTR_HOST): str,
vol.Required(ATTR_PORT): network_port,
}
)

View File

@ -0,0 +1,22 @@
"""Test Matter Server discovery."""
import pytest
import voluptuous as vol
from supervisor.discovery.validate import valid_discovery_config
def test_good_config():
"""Test good Matter Server config."""
valid_discovery_config(
"matter",
{"host": "test", "port": 3812},
)
def test_bad_config():
"""Test bad Matter Server config."""
with pytest.raises(vol.Invalid):
valid_discovery_config("matter", {"host": "test"})