Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while working on the discovery PRs (#427–#429).
nodered/device/triggerreplied success even when Home Assistant couldn't attach the trigger.async_initialize_triggersdoesn't raise when attaching fails: it logs the error and returnsNone. The handler then registered a subscription that would never fire, and the device node showed "registered". One way this happens is when the device's config entry has failed to load. Validation skips the checks that need the integration, so the config passes, and attaching then fails.Contrib already handles an error reply here: the node shows
error_registeringand logs the message withnode.error. So no contrib change is needed.Summary
e883abe Report device triggers that fail to attach
If
async_initialize_triggersreturnsNone, the handler now replies with atrigger_not_attachederror and doesn't store a subscription. HA has already logged the reason, so the message points to the HA log. This is the actual bug fix.42bdfe2 Tidy device trigger error handling
Removes the
except vol.MultipleInvalidblock, since it's a subclass ofvol.Invalidand both blocks did the same thing. Invalid trigger configs are now logged as a single error line instead of a traceback. Runtime errors still log the traceback.533ff9a Reply invalid_config for unknown device action domains
nodered/device/actionlooked up the device automation platform outside thetry. So an unknown domain (raised asInvalidDeviceAutomationConfig) fell through to the generichome_assistant_errorreply instead ofinvalid_config. The lookup has moved inside thetry. Contrib doesn't check the code, so this only changes the reply's error code.Test plan
trigger_not_attachedand stores no subscription (fails before this PR)invalid_config(fails before this PR)vol.MultipleInvalidreplyinginvalid_trigger