1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

BLE client support on ESP32 (#1177)

Co-authored-by: Ben Buxton <bb@cactii.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
buxtronix
2021-05-03 09:10:50 +10:00
committed by GitHub
parent 07db9319ad
commit 02aa75f68c
19 changed files with 1342 additions and 8 deletions

View File

@@ -9,6 +9,8 @@ esphome:
name_add_mac_suffix: true
platform: ESP32
board: nodemcu-32s
platformio_options:
board_build.partitions: huge_app.csv
on_boot:
priority: 150.0
then:
@@ -235,6 +237,19 @@ wled:
adalight:
esp32_ble_tracker:
ble_client:
- mac_address: AA:BB:CC:DD:EE:FF
id: ble_foo
- mac_address: 11:22:33:44:55:66
id: ble_blah
on_connect:
then:
- switch.turn_on: ble1_status
on_disconnect:
then:
- switch.turn_on: ble1_status
mcp23s08:
- id: 'mcp23s08_hub'
cs_pin: GPIO12
@@ -246,6 +261,18 @@ mcp23s17:
deviceaddress: 1
sensor:
- platform: ble_client
ble_client_id: ble_foo
name: "Green iTag btn"
service_uuid: 'ffe0'
characteristic_uuid: 'ffe1'
descriptor_uuid: 'ffe2'
notify: true
update_interval: never
on_notify:
then:
- lambda: |-
ESP_LOGD("green_btn", "Button was pressed, val%f", x);
- platform: adc
pin: A0
name: 'Living Room Brightness'
@@ -1722,6 +1749,8 @@ switch:
# Use pin number 0
number: 0
inverted: False
- platform: template
id: ble1_status
fan:
- platform: binary