Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Jan 20, 2024
1 parent 34b0975 commit 8f6edd0
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 35 deletions.
11 changes: 5 additions & 6 deletions esp32-ble-example-multiple-devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ wifi:
ota:
on_begin:
then:
- lambda: |-
id(bluetooth_client0_enabled_switch).turn_off();
id(bluetooth_client1_enabled_switch).turn_off();
- logger.log: "BLE shutdown for flashing"
- 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 @@ -195,11 +194,11 @@ switch:

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

text_sensor:
Expand Down
9 changes: 4 additions & 5 deletions esp32-ble-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ wifi:
ota:
on_begin:
then:
- lambda: |-
id(bluetooth_enabled_switch).turn_off();
- logger.log: "BLE shutdown for flashing"

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

logger:
level: DEBUG

Expand Down Expand Up @@ -276,7 +275,7 @@ switch:

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

text_sensor:
Expand Down
9 changes: 4 additions & 5 deletions esp32-ble-jk04-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ wifi:
ota:
on_begin:
then:
- lambda: |-
id(bluetooth_enabled_switch).turn_off();
- logger.log: "BLE shutdown for flashing"

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

logger:
level: DEBUG

Expand Down Expand Up @@ -212,5 +211,5 @@ switch:

- platform: ble_client
ble_client_id: client0
id: bluetooth_enabled_switch
id: ble_client_switch0
name: "${name} enable bluetooth connection"
9 changes: 4 additions & 5 deletions esp32-ble-uart-hybrid-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ wifi:
ota:
on_begin:
then:
- lambda: |-
id(bluetooth_enabled_switch).turn_off();
- logger.log: "BLE shutdown for flashing"

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

logger:
level: DEBUG

Expand Down Expand Up @@ -215,7 +214,7 @@ switch:

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

text_sensor:
Expand Down
7 changes: 3 additions & 4 deletions esp32-ble-v11-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ wifi:
ota:
on_begin:
then:
- lambda: |-
id(bluetooth_enabled_switch).turn_off();
- logger.log: "BLE shutdown for flashing"
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"

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

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

text_sensor:
Expand Down
9 changes: 4 additions & 5 deletions yaml-snippets/esp32-ble-block-traffic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ wifi:
ota:
on_begin:
then:
- lambda: |-
id(bluetooth_enabled_switch).turn_off();
- logger.log: "BLE shutdown for flashing"

- 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 @@ -49,5 +48,5 @@ ble_client:
switch:
- platform: ble_client
ble_client_id: client0
id: bluetooth_enabled_switch
id: ble_client_switch0
name: "${name} enable bluetooth connection"
9 changes: 4 additions & 5 deletions yaml-snippets/esp32-ble-energy-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ wifi:
ota:
on_begin:
then:
- lambda: |-
id(bluetooth_enabled_switch).turn_off();
- logger.log: "BLE shutdown for flashing"

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

logger:
level: DEBUG

Expand Down Expand Up @@ -99,5 +98,5 @@ sensor:
switch:
- platform: ble_client
ble_client_id: client0
id: bluetooth_enabled_switch
id: ble_client_switch0
name: "${name} enable bluetooth connection"

0 comments on commit 8f6edd0

Please sign in to comment.