mirror of
https://github.com/esphome/esphome.git
synced 2024-12-10 14:45:56 +01:00
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
|
esphome:
|
||
|
on_boot:
|
||
|
then:
|
||
|
- esp32_ble_tracker.start_scan
|
||
|
- esp32_ble_tracker.stop_scan
|
||
|
|
||
|
esp32_ble_tracker:
|
||
|
on_ble_advertise:
|
||
|
- mac_address:
|
||
|
- AA:BB:CC:DD:EE:FF
|
||
|
- FF:EE:DD:CC:BB:AA
|
||
|
then:
|
||
|
# yamllint disable rule:line-length
|
||
|
- lambda: !lambda |-
|
||
|
ESP_LOGD("main", "The device address (%s) exists in list", x.address_str().c_str());
|
||
|
# yamllint enable rule:line-length
|
||
|
- mac_address: AC:37:43:77:5F:4C
|
||
|
then:
|
||
|
# yamllint disable rule:line-length
|
||
|
- lambda: !lambda |-
|
||
|
ESP_LOGD("main", "The device address is %s", x.address_str().c_str());
|
||
|
# yamllint enable rule:line-length
|
||
|
- then:
|
||
|
# yamllint disable rule:line-length
|
||
|
- lambda: !lambda |-
|
||
|
ESP_LOGD("main", "The device address is %s", x.address_str().c_str());
|
||
|
# yamllint enable rule:line-length
|
||
|
on_ble_service_data_advertise:
|
||
|
- service_uuid: ABCD
|
||
|
then:
|
||
|
- lambda: !lambda |-
|
||
|
ESP_LOGD("main", "Length of service data is %i", x.size());
|
||
|
on_ble_manufacturer_data_advertise:
|
||
|
- manufacturer_id: ABCD
|
||
|
then:
|
||
|
- lambda: !lambda |-
|
||
|
ESP_LOGD("main", "Length of manufacturer data is %i", x.size());
|
||
|
on_scan_end:
|
||
|
- then:
|
||
|
- lambda: |-
|
||
|
ESP_LOGD("ble_auto", "The scan has ended!");
|