Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions supervisor/discovery/const.py
Original file line number Diff line number Diff line change
@@ -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_SERIAL = "serial"
ATTR_SSL = "ssl"
ATTR_URL = "url"
ATTR_USERNAME = "username"
ATTR_API_KEY = "api_key"
ATTR_SERIAL = "serial"
6 changes: 6 additions & 0 deletions supervisor/discovery/services/motioneye.py
Original file line number Diff line number Diff line change
@@ -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 changes: 17 additions & 0 deletions tests/discovery/test_motioneye.py
Original file line number Diff line number Diff line change
@@ -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", {})