How to read the data in ble device?

Hey, guys! I have purchased a ble module, which can connect to the ble device in esphome and send commands to the uuid to control a certain io to a high or low level, but it will not be set to read the value sent by a certain uuid. For example, the ble device will report CC 15 05 06. And then just read 05 06 and convert it to base 10 and multiply it by some number to get the percentage of battery charge. You can then define a binary sensor called button4 that reads a uuid that receives CC 06 E400 as a low level and CC 06 E4 01 as a high level. How to set the code of the above functions? Thank you!