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 templates in rest_command headers #26099

Merged
merged 1 commit into from Nov 26, 2019
Merged

Conversation

@PedroLamas
Copy link
Contributor

PedroLamas commented Aug 20, 2019

Breaking Change:

The rest_command currently only takes a simple string for the headers configuration variable.

This change allows the use of templates inside this variable.

Description

Pull request with documentation for home-assistant.io: home-assistant/home-assistant.io#10213

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]

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

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@homeassistant

This comment has been minimized.

Copy link
Contributor

homeassistant commented Aug 20, 2019

Hi @PedroLamas,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@PedroLamas

This comment has been minimized.

Copy link
Contributor Author

PedroLamas commented Aug 23, 2019

@frenck just noticed the "docs-missing" label, I just added a PR with a small documentation update

@MartinHjelmare MartinHjelmare requested a review from balloob Aug 31, 2019
@frenck frenck removed the docs-missing label Sep 3, 2019
@balloob

This comment has been minimized.

Copy link
Member

balloob commented Sep 5, 2019

What is the use case for making the content type a template?

@PedroLamas

This comment has been minimized.

Copy link
Contributor Author

PedroLamas commented Sep 5, 2019

To be quite honest, no specific one, but in doing so it does allow the usage of script parameters to populate that field!

@PedroLamas

This comment has been minimized.

Copy link
Contributor Author

PedroLamas commented Sep 10, 2019

@balloob anything I can do in regards to this PR?

@balloob

This comment has been minimized.

Copy link
Member

balloob commented Sep 20, 2019

We should not add something that we don't have a use case for.

@tnagels

This comment has been minimized.

Copy link

tnagels commented Oct 25, 2019

There is an important use case for the templated headers: expiring access tokens. Because of the current limitation in HA, i have to use node red to "build" these rest calls.
@PedroLamas any chance of you resubmitting this without the content type template?

@PedroLamas

This comment has been minimized.

Copy link
Contributor Author

PedroLamas commented Oct 25, 2019

@tnagels sure, I'll do it in a bit!

@PedroLamas PedroLamas force-pushed the PedroLamas:dev branch from 0bbe886 to b5e6f8c Oct 25, 2019
@PedroLamas

This comment has been minimized.

Copy link
Contributor Author

PedroLamas commented Oct 25, 2019

@balloob as discussed, I've removed the content-type template and only kept the header ones.

@PedroLamas PedroLamas changed the title Allow templates in rest_command headers and content-type Allow templates in rest_command headers Oct 25, 2019
@PedroLamas PedroLamas force-pushed the PedroLamas:dev branch 4 times, most recently from fca1089 to 900699a Oct 28, 2019
@PedroLamas PedroLamas force-pushed the PedroLamas:dev branch from 900699a to 6f74029 Oct 28, 2019
@PedroLamas

This comment has been minimized.

Copy link
Contributor Author

PedroLamas commented Nov 7, 2019

@frenck any chance of getting you to review this?

@frenck

This comment has been minimized.

Copy link
Member

frenck commented Nov 17, 2019

@PedroLamas Please don't ping random people for reviews. We had a very busy season and are slowly catching up. Please have a little bit of patience. Thanks! 👍

Dev automation moved this from Needs review to Reviewer approved Nov 26, 2019
@balloob balloob merged commit db0008e into home-assistant:dev Nov 26, 2019
11 checks passed
11 checks passed
CI Build #20191028.31 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing 7887850...6f74029
Details
codecov/project 94.34% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Nov 26, 2019
@lock lock bot locked and limited conversation to collaborators Nov 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
5 participants
You can’t perform that action at this time.