[shelly_dimmer] clang-tidy fixes for #7822 (#7844)

This commit is contained in:
Keith Burzinski 2024-11-26 03:53:23 -06:00 committed by GitHub
parent 536bcab5de
commit 2d4688a206
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -466,7 +466,7 @@ bool ShellyDimmer::handle_frame_() {
}
case SHELLY_DIMMER_PROTO_CMD_SWITCH:
case SHELLY_DIMMER_PROTO_CMD_SETTINGS: {
return !(payload_len < 1 || payload[0] != 0x01);
return payload_len >= 1 && payload[0] == 0x01;
}
default: {
return false;