mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 09:36:31 +00:00
Add discovery support for Almond (#1339)
* Add discovery support for Almond * Fix docstring
This commit is contained in:
parent
927b4695c9
commit
615e68b29b
11
hassio/discovery/services/almond.py
Normal file
11
hassio/discovery/services/almond.py
Normal file
@ -0,0 +1,11 @@
|
||||
"""Discovery service for Almond."""
|
||||
import voluptuous as vol
|
||||
|
||||
from hassio.validate import NETWORK_PORT
|
||||
|
||||
from ..const import ATTR_HOST, ATTR_PORT
|
||||
|
||||
|
||||
SCHEMA = vol.Schema(
|
||||
{vol.Required(ATTR_HOST): vol.Coerce(str), vol.Required(ATTR_PORT): NETWORK_PORT}
|
||||
)
|
19
tests/discovery/test_almond.py
Normal file
19
tests/discovery/test_almond.py
Normal file
@ -0,0 +1,19 @@
|
||||
"""Test adguard discovery."""
|
||||
|
||||
import voluptuous as vol
|
||||
import pytest
|
||||
|
||||
from hassio.discovery.validate import valid_discovery_config
|
||||
|
||||
|
||||
def test_good_config():
|
||||
"""Test good deconz config."""
|
||||
|
||||
valid_discovery_config("almond", {"host": "test", "port": 3812})
|
||||
|
||||
|
||||
def test_bad_config():
|
||||
"""Test good adguard config."""
|
||||
|
||||
with pytest.raises(vol.Invalid):
|
||||
valid_discovery_config("almond", {"host": "test"})
|
19
tests/discovery/test_home_panel.py
Normal file
19
tests/discovery/test_home_panel.py
Normal file
@ -0,0 +1,19 @@
|
||||
"""Test adguard discovery."""
|
||||
|
||||
import voluptuous as vol
|
||||
import pytest
|
||||
|
||||
from hassio.discovery.validate import valid_discovery_config
|
||||
|
||||
|
||||
def test_good_config():
|
||||
"""Test good deconz config."""
|
||||
|
||||
valid_discovery_config("home_panel", {"host": "test", "port": 3812})
|
||||
|
||||
|
||||
def test_bad_config():
|
||||
"""Test good adguard config."""
|
||||
|
||||
with pytest.raises(vol.Invalid):
|
||||
valid_discovery_config("home_panel", {"host": "test"})
|
Loading…
x
Reference in New Issue
Block a user