Skip to content

Commit f65f3a9

Browse files
authored
Merge pull request #26 from edwardtfn/dev
Fix toggle with swipe
2 parents 0bf52a2 + 2091fc4 commit f65f3a9

File tree

4 files changed

+55
-64
lines changed

4 files changed

+55
-64
lines changed
+23-57
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Validate and Build ESPHome
2+
name: Validate ESPHome
33

44
# yamllint disable-line rule:truthy
55
on:
@@ -28,32 +28,9 @@ concurrency:
2828
cancel-in-progress: true
2929

3030
jobs:
31-
setup_dependencies:
32-
name: Setup & Cache Dependencies
33-
runs-on: ubuntu-latest
34-
outputs:
35-
cache-hit-arduino: ${{ steps.cache-arduino.outputs.cache-hit }}
36-
37-
steps:
38-
- name: Checkout repository
39-
uses: actions/checkout@main
40-
41-
- name: Cache Arduino Dependencies
42-
id: cache-arduino
43-
uses: actions/cache@main
44-
with:
45-
path: |
46-
~/.esphome/cache
47-
~/.platformio/packages
48-
~/.platformio/platforms
49-
key: ${{ runner.os }}-arduino-${{ hashFiles('**/esphome_ard_basic.yaml') }}
50-
restore-keys: |
51-
${{ runner.os }}-arduino-
52-
5331
code_scan:
5432
name: Code scan (YAML)
5533
runs-on: "ubuntu-latest"
56-
needs: setup_dependencies
5734
steps:
5835
- name: Checkout Code
5936
uses: actions/checkout@main
@@ -71,46 +48,35 @@ jobs:
7148

7249
build_basic:
7350
name: Basic
74-
needs: [code_scan, setup_dependencies]
51+
needs:
52+
- code_scan
7553
runs-on: ubuntu-latest
76-
strategy:
77-
fail-fast: false
78-
matrix:
79-
include:
80-
- id: ard
81-
yaml_file: ".test/esphome_ard_basic.yaml"
82-
cache-hit: ${{ needs.setup_dependencies.outputs.cache-hit-arduino }}
83-
8454
steps:
85-
- name: Checkout repository
86-
uses: actions/checkout@main
87-
88-
- name: Firmware
89-
if: steps.matrix.outputs.cache-hit != 'true'
90-
uses: esphome/[email protected]
55+
- uses: actions/checkout@main
56+
- name: Build core
57+
uses: esphome/build-action@main
9158
with:
92-
yaml_file: ${{ matrix.yaml_file }}
59+
yaml_file: ".test/esphome_ard_basic.yaml"
9360

94-
build_bluetooth_proxy:
95-
name: Bluetooth Proxy
61+
build_bluetooth_proxy_4:
62+
name: Bluetooth Proxy (IDF v4)
9663
needs: build_basic
9764
runs-on: ubuntu-latest
98-
strategy:
99-
matrix:
100-
include:
101-
- id: idf_v4
102-
base: idf_v4
103-
yaml_file: ".test/esphome_idf_bluetooth_proxy.yaml"
104-
- id: idf_v5
105-
base: idf_v5
106-
yaml_file: ".test/esphome_idf5_bluetooth_proxy.yaml"
107-
10865
steps:
109-
- name: Checkout repository
110-
uses: actions/checkout@main
66+
- uses: actions/checkout@main
67+
- name: Build core
68+
uses: esphome/build-action@main
69+
with:
70+
yaml_file: ".test/esphome_idf_bluetooth_proxy.yaml"
11171

112-
- name: Build Bluetooth Proxy Firmware
113-
uses: esphome/[email protected]
72+
build_bluetooth_proxy_5:
73+
name: Bluetooth Proxy (IDF v5)
74+
needs: build_basic
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@main
78+
- name: Build core
79+
uses: esphome/build-action@main
11480
with:
115-
yaml_file: ${{ matrix.yaml_file }}
81+
yaml_file: ".test/esphome_idf5_bluetooth_proxy.yaml"
11682
...

.github/workflows/validate_esphome_beta.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969

7070
- name: Firmware
7171
if: steps.matrix.outputs.cache-hit != 'true'
72-
uses: barndawgie/build-action@v1.9.0
72+
uses: esphome/build-action@main
7373
with:
7474
yaml_file: ${{ matrix.yaml_file }}
7575
version: beta
@@ -93,7 +93,7 @@ jobs:
9393
uses: actions/checkout@main
9494

9595
- name: Build Bluetooth Proxy Firmware
96-
uses: barndawgie/build-action@v1.9.0
96+
uses: esphome/build-action@main
9797
with:
9898
yaml_file: ${{ matrix.yaml_file }}
9999
version: beta

.test/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Gitignore settings for ESPHome
2+
# This is an example and may include too much for your use-case.
3+
# You can modify this file to suit your needs.
4+
/.esphome/
5+
# /secrets.yaml

ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml

+25-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ substitutions:
99
default_transition_length: 500ms
1010
invalid_cooldown: 100ms
1111

12-
version: '0.0.2'
12+
version: '0.0.3'
1313

1414
api:
1515
id: api_server
@@ -41,7 +41,12 @@ binary_sensor:
4141
on_click:
4242
then:
4343
- lambda: |-
44-
if (sl_button_1_action->active_index().has_value() and sl_button_1_action->active_index().value() == 1)
44+
if (sl_button_1_action->active_index().has_value() and
45+
sl_button_1_action->active_index().value() == 1 and
46+
!bs_multi_touch->state and
47+
!bs_swipe_left->state and
48+
!bs_swipe_down->state and
49+
!bs_swipe_right->state)
4550
sw_relay_1->toggle();
4651
send_event_to_ha->execute("bs_button_1", "click");
4752
on_double_click:
@@ -62,7 +67,12 @@ binary_sensor:
6267
on_click:
6368
then:
6469
- lambda: |-
65-
if (sl_button_2_action->active_index().has_value() and sl_button_2_action->active_index().value() == 1)
70+
if (sl_button_2_action->active_index().has_value() and
71+
sl_button_2_action->active_index().value() == 1 and
72+
!bs_multi_touch->state and
73+
!bs_swipe_left->state and
74+
!bs_swipe_down->state and
75+
!bs_swipe_right->state)
6676
sw_relay_2->toggle();
6777
send_event_to_ha->execute("bs_button_2", "click");
6878
on_double_click:
@@ -82,7 +92,12 @@ binary_sensor:
8292
on_click:
8393
then:
8494
- lambda: |-
85-
if (sl_button_3_action->active_index().has_value() and sl_button_3_action->active_index().value() == 1)
95+
if (sl_button_3_action->active_index().has_value() and
96+
sl_button_3_action->active_index().value() == 1 and
97+
!bs_multi_touch->state and
98+
!bs_swipe_left->state and
99+
!bs_swipe_down->state and
100+
!bs_swipe_right->state)
86101
sw_relay_3->toggle();
87102
send_event_to_ha->execute("bs_button_3", "click");
88103
on_double_click:
@@ -102,7 +117,12 @@ binary_sensor:
102117
on_click:
103118
then:
104119
- lambda: |-
105-
if (sl_button_4_action->active_index().has_value() and sl_button_4_action->active_index().value() == 1)
120+
if (sl_button_4_action->active_index().has_value() and
121+
sl_button_4_action->active_index().value() == 1 and
122+
!bs_multi_touch->state and
123+
!bs_swipe_left->state and
124+
!bs_swipe_down->state and
125+
!bs_swipe_right->state)
106126
sw_relay_4->toggle();
107127
send_event_to_ha->execute("bs_button_4", "click");
108128
on_double_click:

0 commit comments

Comments
 (0)