This commit is contained in:
Rapsssito 2024-11-15 16:32:03 +01:00
parent 41a4242aad
commit ebcbada8fe
2 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ CONF_BROADCAST = "broadcast"
CONF_CHARACTERISTICS = "characteristics" CONF_CHARACTERISTICS = "characteristics"
CONF_DESCRIPTION = "description" CONF_DESCRIPTION = "description"
CONF_DESCRIPTORS = "descriptors" CONF_DESCRIPTORS = "descriptors"
CONF_ENDIANNES = "endianness" CONF_ENDIANNESS = "endianness"
CONF_INDICATE = "indicate" CONF_INDICATE = "indicate"
CONF_MANUFACTURER = "manufacturer" CONF_MANUFACTURER = "manufacturer"
CONF_MANUFACTURER_DATA = "manufacturer_data" CONF_MANUFACTURER_DATA = "manufacturer_data"
@ -218,7 +218,7 @@ VALUE_SCHEMA = cv.Schema(
] ]
) # Common encodings ) # Common encodings
), ),
cv.Optional(CONF_ENDIANNES, default="LITTLE"): cv.enum( cv.Optional(CONF_ENDIANNESS, default="LITTLE"): cv.enum(
{ {
"LITTLE": Endianness_ns.LITTLE, "LITTLE": Endianness_ns.LITTLE,
"BIG": Endianness_ns.BIG, "BIG": Endianness_ns.BIG,
@ -325,7 +325,7 @@ async def parse_value(value_config, args):
value, value_config[CONF_TYPE], value_config[CONF_STRING_ENCODING] value, value_config[CONF_TYPE], value_config[CONF_STRING_ENCODING]
) )
buffer_var = cg.variable( buffer_var = cg.variable(
buffer_id, ByteBuffer_ns.wrap(val, value_config[CONF_ENDIANNES]) buffer_id, ByteBuffer_ns.wrap(val, value_config[CONF_ENDIANNESS])
) )
return buffer_var return buffer_var

View File

@ -60,4 +60,4 @@ esp32_ble_server:
value: value:
value: !lambda 'return bytebuffer::ByteBuffer::wrap({0x00, 0x01, 0x02}).get_data();' value: !lambda 'return bytebuffer::ByteBuffer::wrap({0x00, 0x01, 0x02}).get_data();'
- ble_server.characteristic.notify: - ble_server.characteristic.notify:
id: test_notify_characteristic id: test_notify_characteristic