mirror of
https://github.com/esphome/esphome.git
synced 2025-03-13 20:15:17 +01:00
Add tests for esp32_bt_classic & fix required Arduino framework version.
This commit is contained in:
parent
83f448c17d
commit
932e58167f
2 changed files with 48 additions and 1 deletions
|
@ -31,7 +31,7 @@ CODEOWNERS = ["@RoboMagus"]
|
|||
NO_BLUETOOTH_VARIANTS = [esp32_const.VARIANT_ESP32S2]
|
||||
|
||||
MIN_IDF_VERSION = cv.Version(4, 4, 4)
|
||||
MIN_ARDUINO_VERSION = cv.Version(2, 0, 6)
|
||||
MIN_ARDUINO_VERSION = cv.Version(2, 0, 5)
|
||||
|
||||
esp32_bt_classic_ns = cg.esphome_ns.namespace("esp32_bt_classic")
|
||||
ESP32BtClassic = esp32_bt_classic_ns.class_("ESP32BtClassic", cg.Component)
|
||||
|
|
|
@ -41,6 +41,15 @@ mdns:
|
|||
disabled: true
|
||||
|
||||
api:
|
||||
services:
|
||||
- service: scan_bt_devices
|
||||
variables:
|
||||
addresses: string[]
|
||||
num_scans: int
|
||||
then:
|
||||
- bt_classic.bt_classic_scan:
|
||||
mac_address: !lambda "return addresses;"
|
||||
num_scans: !lambda "return num_scans;"
|
||||
|
||||
i2c:
|
||||
sda:
|
||||
|
@ -117,6 +126,16 @@ output:
|
|||
allow_other_uses: true
|
||||
number: GPIO12
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: "BT Scan"
|
||||
on_press:
|
||||
- bt_classic.bt_classic_scan:
|
||||
mac_address:
|
||||
- a1:b2:c3:d4:e5:f6
|
||||
- 1a:2b:3c:4d:5e:6f
|
||||
num_scans: 5
|
||||
|
||||
sensor:
|
||||
- platform: homeassistant
|
||||
entity_id: sensor.hello_world
|
||||
|
@ -515,6 +534,14 @@ binary_sensor:
|
|||
ibeacon_major: 100
|
||||
ibeacon_minor: 1
|
||||
name: BLE Test iBeacon Presence
|
||||
- platform: bt_classic_presence
|
||||
name: BT Classic Presence T1
|
||||
mac_address: a1:b2:c3:d4:e5:f6
|
||||
num_scans: 3
|
||||
update_interval: 30s
|
||||
- platform: bt_classic_presence
|
||||
name: BT Classic Presence T2
|
||||
mac_address: 1a:2b:3c:4d:5e:6f
|
||||
- platform: esp32_touch
|
||||
name: ESP32 Touch Pad GPIO27
|
||||
pin: GPIO27
|
||||
|
@ -625,6 +652,26 @@ mopeka_ble:
|
|||
bluetooth_proxy:
|
||||
active: true
|
||||
|
||||
esp32_bt_classic:
|
||||
on_scan_start:
|
||||
- logger.log: "BT Classic Scan started."
|
||||
on_scan_result:
|
||||
- then:
|
||||
- lambda: |-
|
||||
ESP_LOGD("BT_SCAN_RESULT", "Unfiltered BT Classic scan result:");
|
||||
ESP_LOGD("BT_SCAN_RESULT", " address: %s", address.c_str());
|
||||
ESP_LOGD("BT_SCAN_RESULT", " name: %s", name);
|
||||
ESP_LOGD("BT_SCAN_RESULT", " status: %s (%d)", status.c_str(), status.bt_status());
|
||||
- mac_address:
|
||||
- 11:22:33:44:55:66
|
||||
- aa:bb:cc:dd:ee:ff
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGD("BT_SCAN_RESULT", "Filtered BT Classic scan result:");
|
||||
ESP_LOGD("BT_SCAN_RESULT", " address: %s", address.c_str());
|
||||
ESP_LOGD("BT_SCAN_RESULT", " name: %s", name);
|
||||
ESP_LOGD("BT_SCAN_RESULT", " status: %s (%d)", status.c_str(), status.bt_status());
|
||||
|
||||
xiaomi_rtcgq02lm:
|
||||
- id: motion_rtcgq02lm
|
||||
mac_address: 01:02:03:04:05:06
|
||||
|
|
Loading…
Add table
Reference in a new issue