mirror of
https://github.com/elisspace/core.git
synced 2026-09-29 13:59:54 +00:00
Raise when zwave_js device automation fails validation (#65610)
This commit is contained in:
committed by
Paulus Schoutsen
parent
3babc43fa5
commit
9eeaec4f79
@@ -596,6 +596,23 @@ async def test_failure_scenarios(hass, client, hank_binary_switch, integration):
|
||||
== INVALID_CONFIG
|
||||
)
|
||||
|
||||
# Test invalid device ID fails validation
|
||||
with pytest.raises(InvalidDeviceAutomationConfig):
|
||||
await device_condition.async_validate_condition_config(
|
||||
hass,
|
||||
{
|
||||
"condition": "device",
|
||||
"domain": DOMAIN,
|
||||
"type": "value",
|
||||
"device_id": "invalid_device_id",
|
||||
"command_class": CommandClass.DOOR_LOCK.value,
|
||||
"property": 9999,
|
||||
"property_key": 9999,
|
||||
"endpoint": 9999,
|
||||
"value": 9999,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
async def test_get_value_from_config_failure(
|
||||
hass, client, hank_binary_switch, integration
|
||||
|
||||
@@ -1370,3 +1370,19 @@ async def test_failure_scenarios(hass, client, hank_binary_switch, integration):
|
||||
await device_trigger.async_validate_trigger_config(hass, INVALID_CONFIG)
|
||||
== INVALID_CONFIG
|
||||
)
|
||||
|
||||
# Test invalid device ID fails validation
|
||||
with pytest.raises(InvalidDeviceAutomationConfig):
|
||||
await device_trigger.async_validate_trigger_config(
|
||||
hass,
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "invalid_device_id",
|
||||
"type": "zwave_js.value_updated.value",
|
||||
"command_class": CommandClass.DOOR_LOCK.value,
|
||||
"property": 9999,
|
||||
"property_key": 9999,
|
||||
"endpoint": 9999,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user