Fix HttpRequestResponseTrigger again (#4285)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
fixes https://github.com/esphome/issues/issues/4010
This commit is contained in:
Garret Buell 2023-01-10 17:50:01 -08:00 committed by GitHub
parent 530df91044
commit a19f0c0db0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 2 deletions

View file

@ -52,6 +52,10 @@ jobs:
file: tests/test6.yaml file: tests/test6.yaml
name: Test tests/test6.yaml name: Test tests/test6.yaml
pio_cache_key: test6 pio_cache_key: test6
- id: test
file: tests/test7.yaml
name: Test tests/test7.yaml
pio_cache_key: test7
- id: pytest - id: pytest
name: Run pytest name: Run pytest
- id: clang-format - id: clang-format

View file

@ -31,9 +31,9 @@ struct Header {
const char *value; const char *value;
}; };
class HttpRequestResponseTrigger : public Trigger<int, uint32_t> { class HttpRequestResponseTrigger : public Trigger<int32_t, uint32_t> {
public: public:
void process(int status_code, uint32_t duration_ms) { this->trigger(status_code, duration_ms); } void process(int32_t status_code, uint32_t duration_ms) { this->trigger(status_code, duration_ms); }
}; };
class HttpRequestComponent : public Component { class HttpRequestComponent : public Component {

View file

@ -25,3 +25,4 @@ Current test_.yaml file contents.
| test4.yaml | ESP32 | ethernet | None | test4.yaml | ESP32 | ethernet | None
| test5.yaml | ESP32 | wifi | ble_server | test5.yaml | ESP32 | wifi | ble_server
| test6.yaml | RP2040 | wifi | N/A | test6.yaml | RP2040 | wifi | N/A
| test7.yaml | ESP32-C3 | wifi | N/A

33
tests/test7.yaml Normal file
View file

@ -0,0 +1,33 @@
# Tests for ESP32-C3 boards which use toolchain-riscv32-esp
---
wifi:
ssid: 'ssid'
esp32:
board: lolin_c3_mini
framework:
type: arduino
esphome:
name: 'on-response-test'
on_boot:
then:
- http_request.send:
method: PUT
url: https://esphome.io
headers:
Content-Type: application/json
body: Some data
verify_ssl: false
on_response:
then:
- logger.log:
format: "Response status: %d"
args:
- status_code
logger:
http_request:
useragent: esphome/tagreader
timeout: 10s