mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-15 13:16:29 +00:00
Add discovery support for motionEye (#2850)
This commit is contained in:
parent
0d915a3efc
commit
cee520f0b5
@ -1,10 +1,11 @@
|
||||
"""Discovery static data."""
|
||||
|
||||
ATTR_API_KEY = "api_key"
|
||||
ATTR_HOST = "host"
|
||||
ATTR_PASSWORD = "password"
|
||||
ATTR_PORT = "port"
|
||||
ATTR_PROTOCOL = "protocol"
|
||||
ATTR_SSL = "ssl"
|
||||
ATTR_USERNAME = "username"
|
||||
ATTR_API_KEY = "api_key"
|
||||
ATTR_SERIAL = "serial"
|
||||
ATTR_SSL = "ssl"
|
||||
ATTR_URL = "url"
|
||||
ATTR_USERNAME = "username"
|
||||
|
6
supervisor/discovery/services/motioneye.py
Normal file
6
supervisor/discovery/services/motioneye.py
Normal file
@ -0,0 +1,6 @@
|
||||
"""Discovery service for motionEye."""
|
||||
import voluptuous as vol
|
||||
|
||||
from ..const import ATTR_URL
|
||||
|
||||
SCHEMA = vol.Schema({vol.Required(ATTR_URL): vol.Coerce(str)})
|
17
tests/discovery/test_motioneye.py
Normal file
17
tests/discovery/test_motioneye.py
Normal file
@ -0,0 +1,17 @@
|
||||
"""Test motionEye discovery."""
|
||||
|
||||
import pytest
|
||||
import voluptuous as vol
|
||||
|
||||
from supervisor.discovery.validate import valid_discovery_config
|
||||
|
||||
|
||||
def test_good_config() -> None:
|
||||
"""Test good motionEye config."""
|
||||
valid_discovery_config("motioneye", {"url": "http://example.com:1234"})
|
||||
|
||||
|
||||
def test_bad_config() -> None:
|
||||
"""Test good motionEye config."""
|
||||
with pytest.raises(vol.Invalid):
|
||||
valid_discovery_config("motioneye", {})
|
Loading…
x
Reference in New Issue
Block a user