Skip to content

Commit

Permalink
Add ping pong test examples
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Jan 31, 2023
1 parent 2eb6606 commit 58e3a4c
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ 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'
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
Expand Down
35 changes: 35 additions & 0 deletions tests/esp8266-test-ping.yaml
Original file line number Diff line number Diff line change
@@ -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"
35 changes: 35 additions & 0 deletions tests/esp8266-test-pong.yaml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 58e3a4c

Please sign in to comment.