2021-05-15 01:31:31 +02:00
|
|
|
BLE Client Switch
|
|
|
|
=================
|
2021-05-03 01:11:02 +02:00
|
|
|
|
|
|
|
.. seo::
|
|
|
|
:description: Control the state of BLE clients.
|
|
|
|
:image: bluetooth.svg
|
|
|
|
|
2021-05-15 01:31:31 +02:00
|
|
|
The ``ble_client`` component is a switch platform that is used to enable
|
|
|
|
and disable a ``ble_client``. This has several uses, such as minimizing
|
2021-05-03 01:11:02 +02:00
|
|
|
battery usage or for allowing other clients (Eg phone apps) to connect to
|
|
|
|
the device.
|
|
|
|
|
|
|
|
For more information on BLE services and characteristics, see
|
|
|
|
:doc:`/components/ble_client`.
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
esp32_ble_tracker:
|
|
|
|
|
|
|
|
ble_client:
|
|
|
|
- mac_address: FF:FF:20:00:0F:15
|
|
|
|
id: itag_black
|
|
|
|
|
|
|
|
switch:
|
|
|
|
- platform: ble_client
|
|
|
|
ble_client_id: itag_black
|
|
|
|
name: "Enable iTag"
|
|
|
|
|
|
|
|
Configuration variables:
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
- **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client.
|
2021-05-15 01:31:31 +02:00
|
|
|
- **id** (*Optional*, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
|
2021-05-03 01:11:02 +02:00
|
|
|
- All other options from :ref:`Switch <config-switch>`.
|
|
|
|
|
|
|
|
See Also
|
|
|
|
--------
|
|
|
|
|
|
|
|
- :doc:`/components/ble_client`
|
|
|
|
- :apiref:`ble_client/switch/ble_switch.h`
|
|
|
|
- :ghedit:`Edit`
|