-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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 support for payload_template in rest component #107464
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
f1361d6
to
07715a1
Compare
Related documentation update PR: home-assistant/home-assistant.io#30710 |
0ee2388
to
698a0c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
d9ba00b
to
6d7734d
Compare
6d7734d
to
7faae3b
Compare
@luuuis Thank you for the review and the approval. |
I suppose so @ptashek , I am new and not sure of the process myself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me!
61cbd47
to
8680415
Compare
b5b1bd3
to
3327056
Compare
3327056
to
a69f5c6
Compare
ca0a89a
to
4a5a326
Compare
4a5a326
to
c254ce0
Compare
c254ce0
to
2d99af7
Compare
@@ -61,6 +62,7 @@ | |||
vol.Optional(CONF_USERNAME): cv.string, | |||
vol.Optional(CONF_PASSWORD): cv.string, | |||
vol.Optional(CONF_PAYLOAD): cv.string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This too needs the exclusive marker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @ptashek 👍
I'd like a second opinion before merge though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking at the missing code coverage I'm not so sure about the changes.
Also, the RestData
class is shared with the scrape
integration, does that integration need to be changed too when we make changes here?
Breaking change
Proposed change
This PR picks up where #73106 left off. This change adds the option to use templates in rest sensor payload option, allowing to send dynamically changed payloads to the remote endpoint. This is especially useful with APIs like GraphQL, as demonstrated in my comment on the feature request thread on the community forum.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: