diff --git a/esphome/components/esp32_ble_server/__init__.py b/esphome/components/esp32_ble_server/__init__.py index bf6738ee84..a5db2081b8 100644 --- a/esphome/components/esp32_ble_server/__init__.py +++ b/esphome/components/esp32_ble_server/__init__.py @@ -104,7 +104,9 @@ def validate_notify_action(action_char_id): CORE.data[_KEY_NOTIFY_REQUIRED] = set() CORE.data[_KEY_NOTIFY_REQUIRED].add(action_char_id) # Check if the NOTIFY property is set for the characteristic - char_notify_value = CORE.data.get(_KEY_NOTIFY_PROVIDED, {}).get(action_char_id, None) + char_notify_value = CORE.data.get(_KEY_NOTIFY_PROVIDED, {}).get( + action_char_id, None + ) if char_notify_value is not None and not char_notify_value: raise cv.Invalid( "Missing NOTIFY property for characteristic with notify action" @@ -364,7 +366,9 @@ async def ble_server_characteristic_set_value(config, action_id, template_arg, a BLECharacteristicNotifyAction, cv.Schema( { - cv.Required(CONF_ID): cv.All(cv.use_id(BLECharacteristic), validate_notify_action), + cv.Required(CONF_ID): cv.All( + cv.use_id(BLECharacteristic), validate_notify_action + ), } ), ) diff --git a/esphome/components/esp32_ble_server/ble_server.cpp b/esphome/components/esp32_ble_server/ble_server.cpp index ce9c53e398..4b4b31183b 100644 --- a/esphome/components/esp32_ble_server/ble_server.cpp +++ b/esphome/components/esp32_ble_server/ble_server.cpp @@ -47,7 +47,7 @@ void BLEServer::loop() { for (unsigned i = 0; i < this->services_to_start_.size(); i++) { BLEService *service = this->services_to_start_[i]; if (service->is_created()) { - service->start(); // Needs to be called once per characteristic in the service + service->start(); // Needs to be called once per characteristic in the service } else { index_to_remove = i + 1; } @@ -126,7 +126,7 @@ bool BLEServer::create_device_characteristics_() { BLECharacteristic *manufacturer = this->device_information_service_->create_characteristic(MANUFACTURER_UUID, BLECharacteristic::PROPERTY_READ); manufacturer->set_value( - ByteBuffer::wrap(std::vector(this->manufacturer_.begin(), this->manufacturer_.end()))); + ByteBuffer::wrap(std::vector(this->manufacturer_.begin(), this->manufacturer_.end()))); return true; }