mirror of
https://github.com/esphome/esphome.git
synced 2024-12-28 16:31:44 +01:00
Fix linting
This commit is contained in:
parent
1f5f7561c2
commit
1425e3a3e1
1 changed files with 19 additions and 5 deletions
|
@ -169,8 +169,15 @@ def parse_uuid(uuid):
|
||||||
def parse_descriptor_value(value):
|
def parse_descriptor_value(value):
|
||||||
# Compute the maximum length of the descriptor value
|
# Compute the maximum length of the descriptor value
|
||||||
# Also parse the value for byte arrays
|
# Also parse the value for byte arrays
|
||||||
for val_method in [cv.boolean, cv.float_, cv.hex_uint8_t,
|
for val_method in [
|
||||||
cv.hex_uint16_t, cv.hex_uint32_t, cv.int_, cv.string]:
|
cv.boolean,
|
||||||
|
cv.float_,
|
||||||
|
cv.hex_uint8_t,
|
||||||
|
cv.hex_uint16_t,
|
||||||
|
cv.hex_uint32_t,
|
||||||
|
cv.int_,
|
||||||
|
cv.string
|
||||||
|
]:
|
||||||
try:
|
try:
|
||||||
val = val_method(value)
|
val = val_method(value)
|
||||||
buffer = ByteBuffer_ns.wrap(val)
|
buffer = ByteBuffer_ns.wrap(val)
|
||||||
|
@ -281,9 +288,16 @@ async def parse_characteristic_value(value, args):
|
||||||
args,
|
args,
|
||||||
ByteBuffer,
|
ByteBuffer,
|
||||||
ByteBuffer_ns.wrap,
|
ByteBuffer_ns.wrap,
|
||||||
)
|
)
|
||||||
for val_method in [cv.boolean, cv.float_, cv.hex_uint8_t,
|
for val_method in [
|
||||||
cv.hex_uint16_t, cv.hex_uint32_t, cv.int_, cv.string]:
|
cv.boolean,
|
||||||
|
cv.float_,
|
||||||
|
cv.hex_uint8_t,
|
||||||
|
cv.hex_uint16_t,
|
||||||
|
cv.hex_uint32_t,
|
||||||
|
cv.int_,
|
||||||
|
cv.string
|
||||||
|
]:
|
||||||
try:
|
try:
|
||||||
val = val_method(value)
|
val = val_method(value)
|
||||||
return ByteBuffer_ns.wrap(val)
|
return ByteBuffer_ns.wrap(val)
|
||||||
|
|
Loading…
Reference in a new issue