mirror of
https://github.com/syssi/esphome-votronic.git
synced 2025-07-23 04:23:02 +02:00
Simplify MAC address discovery
This commit is contained in:
@@ -38,6 +38,19 @@ mqtt:
|
||||
|
||||
esp32_ble_tracker:
|
||||
io_capability: keyboard_only
|
||||
on_ble_advertise:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (x.get_name().rfind("votronic", 0) == 0) {
|
||||
ESP_LOGI("ble_adv", "New Votronic BLE controller found");
|
||||
ESP_LOGI("ble_adv", " Name: %s", x.get_name().c_str());
|
||||
ESP_LOGI("ble_adv", " MAC address: %s", x.address_str().c_str());
|
||||
ESP_LOGD("ble_adv", " Advertised service UUIDs:");
|
||||
for (auto uuid : x.get_service_uuids()) {
|
||||
ESP_LOGD("ble_adv", " - %s", uuid.to_string().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ble_client:
|
||||
- mac_address: ${mac_address}
|
||||
|
@@ -29,6 +29,18 @@ api:
|
||||
reboot_timeout: 0s
|
||||
|
||||
esp32_ble_tracker:
|
||||
on_ble_advertise:
|
||||
then:
|
||||
- lambda: |-
|
||||
if (x.get_name().rfind("votronic", 0) == 0) {
|
||||
ESP_LOGI("ble_adv", "New Votronic BLE controller found");
|
||||
ESP_LOGI("ble_adv", " Name: %s", x.get_name().c_str());
|
||||
ESP_LOGI("ble_adv", " MAC address: %s", x.address_str().c_str());
|
||||
ESP_LOGD("ble_adv", " Advertised service UUIDs:");
|
||||
for (auto uuid : x.get_service_uuids()) {
|
||||
ESP_LOGD("ble_adv", " - %s", uuid.to_string().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
text_sensor:
|
||||
- platform: ble_scanner
|
||||
|
Reference in New Issue
Block a user