Skip to content

Commit

Permalink
More examples added to CI 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlo Dudnytskyi committed Sep 16, 2024
1 parent 433286c commit 360ff08
Show file tree
Hide file tree
Showing 15 changed files with 829 additions and 480 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,14 @@ jobs:
- name: Run script and save results
run: python docs/script/process_examples.py docs/examples/sniffing_serial_communication.rst docs/sniffing_serial_communication.tmp
- name: Compare temp file with sniffing_serial_communication.rst
run: diff -u --strip-trailing-cr docs/sniffing_serial_communication.rst docs/sniffing_serial_communication.tmp
run: diff -u --strip-trailing-cr docs/sniffing_serial_communication.rst docs/sniffing_serial_communication.tmp
climate_haier_doc:
name: Check ESPHome climate haier
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Run script and save results
run: python docs/script/process_examples.py docs/examples/climate_haier.rst docs/climate_haier.tmp no_header
- name: Compare temp file with ESPHome climate haier
run: diff -u --strip-trailing-cr docs/climate_haier.tmp docs/esphome-docs/climate/haier.rst
42 changes: 12 additions & 30 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@ on:
branches: [ "master", "dev" , "experimental" ]

jobs:
tests_with_base:
name: Building ${{ matrix.file }}
examples_test:
name: Building ${{ matrix.file.main }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file:
- max-hon.yaml
- max-smartair2.yaml
- min-hon.yaml
- min-smartair2.yaml
- {main: max-hon.yaml, additional: "docs/examples/.base.yaml "}
- {main: max-smartair2.yaml, additional: "docs/examples/.base.yaml"}
- {main: min-hon.yaml, additional: "docs/examples/.base.yaml"}
- {main: min-smartair2.yaml, additional: "docs/examples/.base.yaml"}
- {main: esphome_climate_example.yaml, additional: "docs/examples/.base.yaml docs/examples/.uart.yaml"}
- {main: usb_s3.yaml, additional: ""}
- {main: usb_c3u.yaml, additional: ""}
- {main: uart_sniffer.yaml, additional: ""}
steps:
- name: Checkout code
uses: actions/[email protected]
Expand All @@ -27,33 +31,11 @@ jobs:
- name: Version esphome
run: esphome version
- name: Prepering test file
run: cat docs/examples/.base.yaml docs/examples/${{ matrix.file }} > ./docs/examples/__test__.yaml
run: cat ${{ matrix.file.additional }} docs/examples/${{ matrix.file.main }} > ./docs/examples/__test__.yaml
- name: Preparing secrets.yaml
run: |
echo "wifi_ssid: test_ssid" > ./docs/examples/secrets.yaml
echo "wifi_password: test_pass" >> ./docs/examples/secrets.yaml
- name: Build ESPHome config
run: esphome compile ./docs/examples/__test__.yaml
tests_without_base:
name: Building ${{ matrix.file }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file:
- usb_s3.yaml
- usb_c3u.yaml
- uart_sniffer.yaml
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install esphome
run: pip3 install -U esphome
- name: Version esphome
run: esphome version
- name: Preparing secrets.yaml
run: |
echo "wifi_ssid: test_ssid" > ./docs/examples/secrets.yaml
echo "wifi_password: test_pass" >> ./docs/examples/secrets.yaml
- name: Build ESPHome config
run: esphome compile docs/examples/${{ matrix.file }}

44 changes: 22 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,28 @@ This component requires a `UART Bus <https://esphome.io/components/uart#uart>`_
- VERTICAL
- HORIZONTAL
- BOTH
supported_presets:
- AWAY
- BOOST
- SLEEP
on_alarm_start:
then:
- logger.log:
level: WARN
format: "Alarm activated. Code: %d. Message: \"%s\""
args: [ code, message]
on_alarm_end:
then:
- logger.log:
level: INFO
format: "Alarm deactivated. Code: %d. Message: \"%s\""
args: [ code, message]
on_status_message:
then:
- logger.log:
level: INFO
format: "New status message received, size=%d, subcmd=%02X%02X"
args: [ 'data_size', 'data[0]', 'data[1]' ]
supported_presets:
- AWAY
- BOOST
- SLEEP
on_alarm_start:
then:
- logger.log:
level: WARN
format: "Alarm activated. Code: %d. Message: \"%s\""
args: [ code, message]
on_alarm_end:
then:
- logger.log:
level: INFO
format: "Alarm deactivated. Code: %d. Message: \"%s\""
args: [ code, message]
on_status_message:
then:
- logger.log:
level: INFO
format: "New status message received, size=%d, subcmd=%02X%02X"
args: [ 'data_size', 'data[0]', 'data[1]' ]
Configuration variables:
Expand Down
94 changes: 47 additions & 47 deletions docs/esphome-docs/climate/haier.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,53 +57,53 @@ This component requires a :ref:`UART bus <uart>` to be setup.

.. code-block:: yaml
# Example configuration entry
climate:
- platform: haier
id: haier_ac
protocol: hon
name: Haier AC
uart_id: ac_port
wifi_signal: true
display: true
visual:
min_temperature: 16 °C
max_temperature: 30 °C
temperature_step: 1 °C
supported_modes:
- 'OFF'
- HEAT_COOL
- COOL
- HEAT
- DRY
- FAN_ONLY
supported_swing_modes:
- 'OFF'
- VERTICAL
- HORIZONTAL
- BOTH
supported_presets:
- AWAY
- BOOST
- SLEEP
on_alarm_start:
then:
- logger.log:
level: WARN
format: "Alarm activated. Code: %d. Message: \"%s\""
args: [ code, message]
on_alarm_end:
then:
- logger.log:
level: INFO
format: "Alarm deactivated. Code: %d. Message: \"%s\""
args: [ code, message]
on_status_message:
then:
- logger.log:
level: INFO
format: "New status message received, size=%d, subcmd=%02X%02X"
args: [ 'data_size', 'data[0]', 'data[1]' ]
# Example configuration entry
climate:
- platform: haier
id: haier_ac
protocol: hon
name: Haier AC
uart_id: ac_port
wifi_signal: true
display: true
visual:
min_temperature: 16 °C
max_temperature: 30 °C
temperature_step: 1 °C
supported_modes:
- 'OFF'
- HEAT_COOL
- COOL
- HEAT
- DRY
- FAN_ONLY
supported_swing_modes:
- 'OFF'
- VERTICAL
- HORIZONTAL
- BOTH
supported_presets:
- AWAY
- BOOST
- SLEEP
on_alarm_start:
then:
- logger.log:
level: WARN
format: "Alarm activated. Code: %d. Message: \"%s\""
args: [ code, message]
on_alarm_end:
then:
- logger.log:
level: INFO
format: "Alarm deactivated. Code: %d. Message: \"%s\""
args: [ code, message]
on_status_message:
then:
- logger.log:
level: INFO
format: "New status message received, size=%d, subcmd=%02X%02X"
args: [ 'data_size', 'data[0]', 'data[1]' ]
Configuration variables:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/.base.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
esphome:
esphome:
name: esp32-haier-example

esp32:
Expand Down
6 changes: 6 additions & 0 deletions docs/examples/.uart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

uart:
baud_rate: 9600
tx_pin: 17
rx_pin: 16
id: ac_port
Loading

0 comments on commit 360ff08

Please sign in to comment.