Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspend BLE connection during OTA updates (Closes: #416) #417

Merged
merged 3 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions esp32-ble-example-multiple-devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ wifi:
password: !secret wifi_password

ota:
on_begin:
then:
- switch.turn_off: ble_client_switch0
- switch.turn_off: ble_client_switch1
- logger.log: "BLE connection suspended for OTA update"

logger:
level: DEBUG
Expand Down Expand Up @@ -189,9 +194,11 @@ switch:

- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${bms0} enable bluetooth connection"
- platform: ble_client
ble_client_id: client1
id: ble_client_switch1
name: "${bms1} enable bluetooth connection"

text_sensor:
Expand Down
5 changes: 5 additions & 0 deletions esp32-ble-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ wifi:
password: !secret wifi_password

ota:
on_begin:
then:
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"

logger:
level: DEBUG
Expand Down Expand Up @@ -271,6 +275,7 @@ switch:

- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${name} enable bluetooth connection"

text_sensor:
Expand Down
5 changes: 5 additions & 0 deletions esp32-ble-jk04-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ wifi:
password: !secret wifi_password

ota:
on_begin:
then:
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"

logger:
level: DEBUG
Expand Down Expand Up @@ -207,4 +211,5 @@ switch:

- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${name} enable bluetooth connection"
5 changes: 5 additions & 0 deletions esp32-ble-uart-hybrid-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ wifi:
password: !secret wifi_password

ota:
on_begin:
then:
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"

logger:
level: DEBUG
Expand Down Expand Up @@ -210,6 +214,7 @@ switch:

- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${name} enable bluetooth connection"

text_sensor:
Expand Down
5 changes: 5 additions & 0 deletions esp32-ble-v11-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ wifi:
password: !secret wifi_password

ota:
on_begin:
then:
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"

logger:
level: DEBUG
Expand Down Expand Up @@ -277,6 +281,7 @@ switch:

- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${name} enable bluetooth connection"

text_sensor:
Expand Down
9 changes: 9 additions & 0 deletions esp32-heltec-balancer-ble-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ wifi:
password: !secret wifi_password

ota:
on_begin:
then:
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"

logger:
level: DEBUG
Expand Down Expand Up @@ -232,6 +236,11 @@ switch:
balancer:
name: "${name} balancer"

- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${name} enable bluetooth connection"

text_sensor:
- platform: heltec_balancer_ble
# Not implemented
Expand Down
6 changes: 6 additions & 0 deletions yaml-snippets/esp32-ble-block-traffic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ wifi:
password: !secret wifi_password

ota:
on_begin:
then:
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"

logger:

# If you don't use Home Assistant please remove this `api` section and uncomment the `mqtt` component!
Expand All @@ -43,4 +48,5 @@ ble_client:
switch:
- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${name} enable bluetooth connection"
5 changes: 5 additions & 0 deletions yaml-snippets/esp32-ble-energy-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ wifi:
password: !secret wifi_password

ota:
on_begin:
then:
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"

logger:
level: DEBUG
Expand Down Expand Up @@ -94,4 +98,5 @@ sensor:
switch:
- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${name} enable bluetooth connection"
Loading