[usb_cdc_acm][scd4x][pulse_counter][mopeka_std_check][ruuvi_ble] Fix assorted one-liner bugs (#14495)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jonathan SwobodaandClaude Opus 4.6 authored and GitHub committed 2026-03-05 09:47:55 -10:00
1 parent 9961c8180a
commit 22d90d702d
6 files changed
+16 -11

No files matched your search

@@ -108,7 +108,7 @@ bool MopekaStdCheck::parse_device(const esp32_ble_tracker::ESPBTDevice &device)
}
// Get temperature of sensor
uint8_t temp_in_c = this->parse_temperature_(mopeka_data);
int8_t temp_in_c = this->parse_temperature_(mopeka_data);
if (this->temperature_ != nullptr) {
this->temperature_->publish_state(temp_in_c);
}
@@ -223,12 +223,12 @@ uint8_t MopekaStdCheck::parse_battery_level_(const mopeka_std_package *message)
return (uint8_t) percent;
}
uint8_t MopekaStdCheck::parse_temperature_(const mopeka_std_package *message) {
int8_t MopekaStdCheck::parse_temperature_(const mopeka_std_package *message) {
uint8_t tmp = message->raw_temp;
if (tmp == 0x0) {
return -40;
} else {
return (uint8_t) ((tmp - 25.0f) * 1.776964f);
return static_cast<int8_t>((tmp - 25.0f) * 1.776964f);
}
}