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

Allow service data to be passed to shell_command #2362

Merged
merged 1 commit into from
Jun 23, 2016
Merged

Allow service data to be passed to shell_command #2362

merged 1 commit into from
Jun 23, 2016

Conversation

dale3h
Copy link
Member

@dale3h dale3h commented Jun 23, 2016

Description:
Remove the shell command schema so that service data can successfully be passed to the shell command.
Parse args with shlex instead, allowing spaces to be used in the variable data that is passed.

Related issue (if applicable): fixes #2268

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#

Example entry for configuration.yaml (if applicable):

shell_command:
  garage_opened: './garage_opened.sh --device="{{ device }}" --door={{ door }}'


automation:
  alias: Garage Door is Open
  trigger:
    platform: state
    entity_id: sensor.garage_door
    state: 'open'
  action:
    service: shell_command.garage_opened
    data:
      device: Garage Door
      door: 1

Checklist:

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

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@balloob balloob merged commit 600a3e3 into home-assistant:dev Jun 23, 2016
@balloob
Copy link
Member

balloob commented Jun 23, 2016

That's better ;-)

@dale3h dale3h deleted the shell_command_data branch July 4, 2016 18:19
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants