From 68778cbc35841b3c0d5ea79a01dc87eaf077aa57 Mon Sep 17 00:00:00 2001 From: Oxan van Leeuwen Date: Wed, 22 Sep 2021 12:35:19 +0200 Subject: [PATCH] Fix clang-tidy warnings --- esphome/components/xiaomi_ble/xiaomi_ble.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/xiaomi_ble/xiaomi_ble.cpp b/esphome/components/xiaomi_ble/xiaomi_ble.cpp index 8db250e152..1eee6cb7e0 100644 --- a/esphome/components/xiaomi_ble/xiaomi_ble.cpp +++ b/esphome/components/xiaomi_ble/xiaomi_ble.cpp @@ -70,11 +70,11 @@ bool parse_xiaomi_value(uint8_t value_type, const uint8_t *data, uint8_t value_l } // open/close state, 1 byte, 8-bit unsigned integer, 1:closed or 0,2:opened else if ((value_type == 0x19) && (value_length == 1)) { - result.is_open = (data[0] != 0x01) ? true : false; + result.is_open = data[0] != 0x01; } // light, 1 byte, 0 or 1 else if ((value_type == 0x18) && (value_length == 1)) { - result.is_light = (data[0]) ? true : false; + result.is_light = data[0]; } // idle time since last motion, 4 byte, 32-bit unsigned integer, 1 min else if ((value_type == 0x17) && (value_length == 4)) {