Skip to content

Commit 36dceae

Browse files
authored
Merge pull request #138 from ypid/fix/on_boot_config_merge
Allow users to add on_boot entries by converting to list
2 parents ddaa42b + 39e15ae commit 36dceae

File tree

5 files changed

+75
-75
lines changed

5 files changed

+75
-75
lines changed

packages/airgradient_api_d1_mini.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ switch:
3838

3939
esphome:
4040
on_boot:
41-
priority: 200 # Network connections setup
42-
then:
43-
if:
44-
condition:
45-
switch.is_on: upload_airgradient
46-
then:
47-
- http_request.post:
48-
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
49-
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
50-
url: !lambda |-
51-
return "https://hw.airgradient.com/sensors/airgradient:" + get_mac_address().substr(6,11) + "/measures";
52-
headers:
53-
Content-Type: application/json
54-
json:
55-
wifi: !lambda return to_string(-50);
41+
- priority: 200 # Network connections setup
42+
then:
43+
if:
44+
condition:
45+
switch.is_on: upload_airgradient
46+
then:
47+
- http_request.post:
48+
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
49+
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
50+
url: !lambda |-
51+
return "https://hw.airgradient.com/sensors/airgradient:" + get_mac_address().substr(6,11) + "/measures";
52+
headers:
53+
Content-Type: application/json
54+
json:
55+
wifi: !lambda return to_string(-50);
5656

5757
http_request:
5858
timeout: 1s # Setting short to try to prevent watchdog reboots https://github.com/esphome/issues/issues/2853

packages/airgradient_api_d1_mini_insecure.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ switch:
3838

3939
esphome:
4040
on_boot:
41-
priority: 200 # Network connections setup
42-
then:
43-
if:
44-
condition:
45-
switch.is_on: upload_airgradient
46-
then:
47-
- http_request.post:
48-
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
49-
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
50-
url: !lambda |-
51-
return "http://hw.airgradient.com/sensors/airgradient:" + get_mac_address().substr(6,11) + "/measures";
52-
headers:
53-
Content-Type: application/json
54-
json:
55-
wifi: !lambda return to_string(-50);
41+
- priority: 200 # Network connections setup
42+
then:
43+
if:
44+
condition:
45+
switch.is_on: upload_airgradient
46+
then:
47+
- http_request.post:
48+
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
49+
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
50+
url: !lambda |-
51+
return "http://hw.airgradient.com/sensors/airgradient:" + get_mac_address().substr(6,11) + "/measures";
52+
headers:
53+
Content-Type: application/json
54+
json:
55+
wifi: !lambda return to_string(-50);
5656

5757
http_request:
5858
timeout: 1s # Setting short to try to prevent watchdog reboots http://github.com/esphome/issues/issues/2853

packages/airgradient_api_d1_mini_no_sgp41.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ switch:
3636

3737
esphome:
3838
on_boot:
39-
priority: 200 # Network connections setup
40-
then:
41-
if:
42-
condition:
43-
switch.is_on: upload_airgradient
44-
then:
45-
- http_request.post:
46-
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
47-
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
48-
url: !lambda |-
49-
return "https://hw.airgradient.com/sensors/airgradient:" + get_mac_address().substr(6,11) + "/measures";
50-
headers:
51-
Content-Type: application/json
52-
json:
53-
wifi: !lambda return to_string(-50);
39+
- priority: 200 # Network connections setup
40+
then:
41+
if:
42+
condition:
43+
switch.is_on: upload_airgradient
44+
then:
45+
- http_request.post:
46+
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
47+
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
48+
url: !lambda |-
49+
return "https://hw.airgradient.com/sensors/airgradient:" + get_mac_address().substr(6,11) + "/measures";
50+
headers:
51+
Content-Type: application/json
52+
json:
53+
wifi: !lambda return to_string(-50);
5454

5555
http_request:
5656
timeout: 1s # Setting short to try to prevent watchdog reboots https://github.com/esphome/issues/issues/2853

packages/airgradient_api_esp32-c3.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ switch:
4040

4141
esphome:
4242
on_boot:
43-
priority: 200 # Network connections setup
44-
then:
45-
if:
46-
condition:
47-
switch.is_on: upload_airgradient
48-
then:
49-
- http_request.post:
50-
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
51-
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
52-
url: !lambda |-
53-
return "https://hw.airgradient.com/sensors/airgradient:" + get_mac_address() + "/measures";
54-
headers:
55-
Content-Type: application/json
56-
json:
57-
wifi: !lambda return to_string(-50);
43+
- priority: 200 # Network connections setup
44+
then:
45+
if:
46+
condition:
47+
switch.is_on: upload_airgradient
48+
then:
49+
- http_request.post:
50+
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
51+
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
52+
url: !lambda |-
53+
return "https://hw.airgradient.com/sensors/airgradient:" + get_mac_address() + "/measures";
54+
headers:
55+
Content-Type: application/json
56+
json:
57+
wifi: !lambda return to_string(-50);
5858

5959
http_request:
6060
# Used to support POST request to send data to AirGradient

packages/airgradient_api_esp32-c3_dual_pms5003t.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,21 @@ switch:
7272

7373
esphome:
7474
on_boot:
75-
priority: 200 # Network connections setup
76-
then:
77-
if:
78-
condition:
79-
switch.is_on: upload_airgradient
80-
then:
81-
- http_request.post:
82-
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
83-
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
84-
url: !lambda |-
85-
return "https://hw.airgradient.com/sensors/airgradient:" + get_mac_address() + "/measures";
86-
headers:
87-
Content-Type: application/json
88-
json:
89-
wifi: !lambda return to_string(-50);
75+
- priority: 200 # Network connections setup
76+
then:
77+
if:
78+
condition:
79+
switch.is_on: upload_airgradient
80+
then:
81+
- http_request.post:
82+
# Return wifi signal -50 as soon as device boots to show activity on AirGradient Dashboard site
83+
# Using -50 instead of actual value as the wifi_signal sensor has not reported a value at this point in boot process
84+
url: !lambda |-
85+
return "https://hw.airgradient.com/sensors/airgradient:" + get_mac_address() + "/measures";
86+
headers:
87+
Content-Type: application/json
88+
json:
89+
wifi: !lambda return to_string(-50);
9090

9191
http_request:
9292
# Used to support POST request to send data to AirGradient

0 commit comments

Comments
 (0)