New Events and Context Fixes#18765
Conversation
… image processing, add tests to ensure same context
homeassistant/components/script.py
Outdated
| """Turn the script on.""" | ||
| context = kwargs.get('context') | ||
| self.async_set_context(context) | ||
| self.hass.bus.async_fire(EVENT_SCRIPT_RUN, { |
There was a problem hiding this comment.
So we have a bit of a weird thing right now with scripts that include a delay that get turned on . It means that we don't always start a new script, but sometimes just continue it. (it's kinda weird honestly). So we might want to check that.
There was a problem hiding this comment.
I will add an attribute to the event data to determine if it is a new run or a continuation based on self.script.is_running in the component, then add it to logbook for "{{name}} started" and "{{name}} continued" for scripts. I currently only added automations to logbook.
There was a problem hiding this comment.
Looks like scripts running again to bypass delay has been disabled based on this: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/script.py#L118-L119
There was a problem hiding this comment.
Okay, then that's not a problem then !
|
Is this a breaking change? |
Description:
Adds new core events for automation trigger and script run per discord conversation with @balloob.
Removes custom logbook event for automations and adds the new automation event to the logbook. Also fixes carrying over context for image processing from the service call.
Checklist:
tox. Your PR cannot be merged unless tests passIf the code does not interact with devices: