Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mode parameter to custom intent scripts #102203

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

tetele
Copy link
Contributor

@tetele tetele commented Oct 18, 2023

Breaking change

No

Proposed change

Add a mode parameter to custom intent_scripts to prevent the behavior described in #102199. Allows an intent to have multiple instances running in parallel

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@tetele
Copy link
Contributor Author

tetele commented Nov 8, 2023

There are no code owners for the intent_script integration so maybe you can assign someone @synesthesiam. Thanks!

@synesthesiam
Copy link
Contributor

synesthesiam commented Nov 8, 2023

@tetele I'm wondering if we should re-use CONF_MODE here instead, since this seems to be used in the same way elsewhere:

def make_script_schema(

@tetele
Copy link
Contributor Author

tetele commented Nov 8, 2023

@synesthesiam is the script schema fully exposed in the intent_script? 'Cause if not, i don't see how we could. Or maybe i didn't fully understand your suggestion.

@synesthesiam
Copy link
Contributor

I just meant using the predefined CONF_MODE instead of the custom CONF_SCRIPT_MODE

@tetele
Copy link
Contributor Author

tetele commented Nov 8, 2023

Oh, OK. Then i think script_mode is more explicit than mode, as you are not in the context of a script. But I definitely am not clinging to this notation and i'm more than happy to change it if you think we should.

@synesthesiam
Copy link
Contributor

I agree that script_mode is more descriptive, but I think the trade-off is worth it to use CONF_MODE since it's used by the script domain and it should have translations, etc. already.

@tetele
Copy link
Contributor Author

tetele commented Nov 9, 2023

@synesthesiam done

@synesthesiam synesthesiam merged commit 527a3db into home-assistant:dev Nov 9, 2023
20 checks passed
@synesthesiam
Copy link
Contributor

Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2023
@frenck frenck changed the title Add script_mode parameter to custom intent scripts Add mode parameter to custom intent scripts Nov 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intent scripts run in single mode, which prevent an intent from calling itself
2 participants