mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-26 12:43:48 +00:00 
			
		
		
		
	Include the bluetooth mac address in the device info when proxy is enabled (#8203)
This commit is contained in:
		| @@ -15,6 +15,9 @@ | ||||
|  | ||||
| #include "bluetooth_connection.h" | ||||
|  | ||||
| #include <esp_bt.h> | ||||
| #include <esp_bt_device.h> | ||||
|  | ||||
| namespace esphome { | ||||
| namespace bluetooth_proxy { | ||||
|  | ||||
| @@ -114,6 +117,11 @@ class BluetoothProxy : public esp32_ble_tracker::ESPBTDeviceListener, public Com | ||||
|     return flags; | ||||
|   } | ||||
|  | ||||
|   std::string get_bluetooth_mac_address_pretty() { | ||||
|     const uint8_t *mac = esp_bt_dev_get_address(); | ||||
|     return str_snprintf("%02X:%02X:%02X:%02X:%02X:%02X", 17, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); | ||||
|   } | ||||
|  | ||||
|  protected: | ||||
|   void send_api_packet_(const esp32_ble_tracker::ESPBTDevice &device); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user