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 actions in web_server to be executed via GET method #5938

Merged

Conversation

afarago
Copy link
Contributor

@afarago afarago commented Dec 14, 2023

What does this implement/fix?

Allow actions to be executed via GET methods as well.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Detailed use

My use case: allow simple local network webhook usage from a Shelly device.

This can be called as http://<ip_address>/button/template_button/press

Related issue or feature (if applicable): fixes
not applicable

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#
not applicable

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

# Example config.yaml
web_server:

button:
  - platform: template
    name: "Template Button"
    on_press:
      - logger.log: Button Pressed

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

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

@afarago afarago changed the title allow actions to be executed via GET metod as well Allow actions in web_server to be executed via GET metod as well Dec 14, 2023
Copy link
Contributor

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Mar 14, 2024
@jesserockz jesserockz changed the title Allow actions in web_server to be executed via GET metod as well Allow button press action in web_server to be executed via GET method Mar 14, 2024
@jesserockz jesserockz added this to the 2024.3.0b2 milestone Mar 14, 2024
@jesserockz jesserockz merged commit df5dfb8 into esphome:dev Mar 14, 2024
46 checks passed
@jesserockz jesserockz changed the title Allow button press action in web_server to be executed via GET method Allow actions in web_server to be executed via GET method Mar 14, 2024
@jesserockz jesserockz mentioned this pull request Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2024
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.

None yet

2 participants