Ignore certain device trigger validation errors (#83972)
This commit is contained in:
parent
353fb3be7d
commit
59b6d56207
3 changed files with 4 additions and 2 deletions
|
@ -68,7 +68,7 @@ async def async_validate_trigger_config(
|
||||||
# Only call the dynamic validator if the relevant config entry is loaded
|
# Only call the dynamic validator if the relevant config entry is loaded
|
||||||
registry = dr.async_get(hass)
|
registry = dr.async_get(hass)
|
||||||
if not (device := registry.async_get(config[CONF_DEVICE_ID])):
|
if not (device := registry.async_get(config[CONF_DEVICE_ID])):
|
||||||
raise InvalidDeviceAutomationConfig
|
return config
|
||||||
|
|
||||||
device_config_entry = None
|
device_config_entry = None
|
||||||
for entry_id in device.config_entries:
|
for entry_id in device.config_entries:
|
||||||
|
@ -80,7 +80,7 @@ async def async_validate_trigger_config(
|
||||||
break
|
break
|
||||||
|
|
||||||
if not device_config_entry:
|
if not device_config_entry:
|
||||||
raise InvalidDeviceAutomationConfig
|
return config
|
||||||
|
|
||||||
if not await hass.config_entries.async_wait_component(device_config_entry):
|
if not await hass.config_entries.async_wait_component(device_config_entry):
|
||||||
return config
|
return config
|
||||||
|
|
|
@ -349,6 +349,7 @@ async def test_functional_device_trigger(
|
||||||
assert automation_calls[0].data["some"] == "test_trigger_button_press"
|
assert automation_calls[0].data["some"] == "test_trigger_button_press"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip(reason="Temporarily disabled until automation validation is improved")
|
||||||
async def test_validate_trigger_unknown_device(hass, aioclient_mock):
|
async def test_validate_trigger_unknown_device(hass, aioclient_mock):
|
||||||
"""Test unknown device does not return a trigger config."""
|
"""Test unknown device does not return a trigger config."""
|
||||||
await setup_deconz_integration(hass, aioclient_mock)
|
await setup_deconz_integration(hass, aioclient_mock)
|
||||||
|
|
|
@ -372,6 +372,7 @@ async def test_exception_bad_trigger(hass, mock_devices, calls, caplog):
|
||||||
assert "Invalid config for [automation]" in caplog.text
|
assert "Invalid config for [automation]" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip(reason="Temporarily disabled until automation validation is improved")
|
||||||
async def test_exception_no_device(hass, mock_devices, calls, caplog):
|
async def test_exception_no_device(hass, mock_devices, calls, caplog):
|
||||||
"""Test for exception on event triggers firing."""
|
"""Test for exception on event triggers firing."""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue