From 30ef06ebd0a96ab1b1dc15342ff60a4e833ba785 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Tue, 31 Jan 2023 09:08:03 +0100 Subject: [PATCH] Add ping pong test examples --- .github/workflows/ci.yaml | 6 ++++++ tests/esp8266-test-ping.yaml | 35 +++++++++++++++++++++++++++++++++++ tests/esp8266-test-pong.yaml | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 tests/esp8266-test-ping.yaml create mode 100644 tests/esp8266-test-pong.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d80a63ec..30c21a7f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,10 +36,16 @@ jobs: - name: Write secrets.yaml shell: bash run: 'echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > secrets.yaml' + - name: Write tests/secrets.yaml + shell: bash + run: 'echo -e "wifi_ssid: ssid\nwifi_password: password\nmqtt_host: host\nmqtt_username: username\nmqtt_password: password" > tests/secrets.yaml' - run: | esphome config esp32-example.yaml - run: | esphome config esp8266-example.yaml + esphome config tests/esp8266-test-ping.yaml + esphome config tests/esp8266-test-pong.yaml + esphome config tests/esp8266-test-protocols.yaml esphome-compile: runs-on: ubuntu-latest diff --git a/tests/esp8266-test-ping.yaml b/tests/esp8266-test-ping.yaml new file mode 100644 index 00000000..db11adac --- /dev/null +++ b/tests/esp8266-test-ping.yaml @@ -0,0 +1,35 @@ +substitutions: + name: pipsolar-test-ping + tx_pin: GPIO4 + rx_pin: GPIO5 + +esphome: + name: ${name} + platform: ESP8266 + board: d1_mini + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +api: +ota: +logger: + +uart: + id: uart0 + baud_rate: 2400 + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + debug: + direction: BOTH + dummy_receiver: true + after: + delimiter: "\r" + sequence: + - lambda: UARTDebug::log_string(direction, bytes); + +interval: + - interval: 2s + then: + - uart.write: "ping\r" diff --git a/tests/esp8266-test-pong.yaml b/tests/esp8266-test-pong.yaml new file mode 100644 index 00000000..56f38f42 --- /dev/null +++ b/tests/esp8266-test-pong.yaml @@ -0,0 +1,35 @@ +substitutions: + name: pipsolar-test-pong + tx_pin: GPIO4 + rx_pin: GPIO5 + +esphome: + name: ${name} + platform: ESP8266 + board: d1_mini + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +api: +ota: +logger: + +uart: + id: uart0 + baud_rate: 2400 + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + debug: + direction: BOTH + dummy_receiver: true + after: + delimiter: "\r" + sequence: + - lambda: UARTDebug::log_string(direction, bytes); + +interval: + - interval: 2s + then: + - uart.write: "pong\r"