mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 04:06:33 +00:00
Update API data for deconz (#989)
* Update API data for deconz * Fix tests
This commit is contained in:
parent
8451020afe
commit
2ae93ae7b1
@ -6,3 +6,5 @@ ATTR_PORT = "port"
|
|||||||
ATTR_PROTOCOL = "protocol"
|
ATTR_PROTOCOL = "protocol"
|
||||||
ATTR_SSL = "ssl"
|
ATTR_SSL = "ssl"
|
||||||
ATTR_USERNAME = "username"
|
ATTR_USERNAME = "username"
|
||||||
|
ATTR_API_KEY = "api_key"
|
||||||
|
ATTR_SERIAL = "serial"
|
||||||
|
@ -3,9 +3,14 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from hassio.validate import NETWORK_PORT
|
from hassio.validate import NETWORK_PORT
|
||||||
|
|
||||||
from ..const import ATTR_HOST, ATTR_PORT
|
from ..const import ATTR_HOST, ATTR_PORT, ATTR_API_KEY, ATTR_SERIAL
|
||||||
|
|
||||||
|
|
||||||
SCHEMA = vol.Schema(
|
SCHEMA = vol.Schema(
|
||||||
{vol.Required(ATTR_HOST): vol.Coerce(str), vol.Required(ATTR_PORT): NETWORK_PORT}
|
{
|
||||||
|
vol.Required(ATTR_HOST): vol.Coerce(str),
|
||||||
|
vol.Required(ATTR_PORT): NETWORK_PORT,
|
||||||
|
vol.Required(ATTR_SERIAL): vol.Coerce(str),
|
||||||
|
vol.Required(ATTR_API_KEY): vol.Coerce(str),
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
@ -9,11 +9,14 @@ from hassio.discovery.validate import valid_discovery_config
|
|||||||
def test_good_config():
|
def test_good_config():
|
||||||
"""Test good deconz config."""
|
"""Test good deconz config."""
|
||||||
|
|
||||||
valid_discovery_config("deconz", {"host": "test", "port": 3812})
|
valid_discovery_config(
|
||||||
|
"deconz",
|
||||||
|
{"host": "test", "port": 3812, "api_key": "MY_api_KEY99", "serial": "xyz"},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_bad_config():
|
def test_bad_config():
|
||||||
"""Test good deconz config."""
|
"""Test good deconz config."""
|
||||||
|
|
||||||
with pytest.raises(vol.Invalid):
|
with pytest.raises(vol.Invalid):
|
||||||
valid_discovery_config("deconz", {"host": "test"})
|
valid_discovery_config("deconz", {"host": "test", "port": 8080})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user