mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-10 10:46:29 +00:00
Discovery for vlc telnet (#2573)
This commit is contained in:
parent
6f542d58d5
commit
a6e4b5159e
15
supervisor/discovery/services/vlc_telnet.py
Normal file
15
supervisor/discovery/services/vlc_telnet.py
Normal file
@ -0,0 +1,15 @@
|
||||
"""Discovery service for VLC Telnet."""
|
||||
import voluptuous as vol
|
||||
|
||||
from supervisor.validate import network_port
|
||||
|
||||
from ..const import ATTR_HOST, ATTR_PASSWORD, ATTR_PORT
|
||||
|
||||
# pylint: disable=no-value-for-parameter
|
||||
SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Required(ATTR_HOST): str,
|
||||
vol.Required(ATTR_PORT): network_port,
|
||||
vol.Required(ATTR_PASSWORD): str,
|
||||
}
|
||||
)
|
22
tests/discovery/test_vlc_telnet.py
Normal file
22
tests/discovery/test_vlc_telnet.py
Normal file
@ -0,0 +1,22 @@
|
||||
"""Test VLC Telnet discovery."""
|
||||
|
||||
import pytest
|
||||
import voluptuous as vol
|
||||
|
||||
from supervisor.discovery.validate import valid_discovery_config
|
||||
|
||||
|
||||
def test_good_config():
|
||||
"""Test good vlc telnet config."""
|
||||
|
||||
valid_discovery_config(
|
||||
"vlc_telnet",
|
||||
{"host": "test", "port": 3812, "password": "darksideofthemoon"},
|
||||
)
|
||||
|
||||
|
||||
def test_bad_config():
|
||||
"""Test bad vlc telnet config."""
|
||||
|
||||
with pytest.raises(vol.Invalid):
|
||||
valid_discovery_config("vlc_telnet", {"host": "test", "port": 8283})
|
Loading…
x
Reference in New Issue
Block a user