Skip to content

Commit

Permalink
Use explicit type
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed May 24, 2022
1 parent e92d3f7 commit 59c6240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/ant_bms/ant_bms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void AntBms::on_status_data_(const std::vector<uint8_t> &data) {
this->publish_state_(this->cells_[i].cell_voltage_sensor_, (float) ant_get_16bit(i * 2 + 6) * 0.001f);
}
// 70 0x00 0x00 0x00 0x00: Current 0.0 A 0.1 A
float current = ((int) ant_get_32bit(70)) * 0.1f;
float current = ((int32_t) ant_get_32bit(70)) * 0.1f;
this->publish_state_(this->current_sensor_, current);
// 74 0x64: SOC 100 % 1.0 %
this->publish_state_(this->soc_sensor_, (float) data[74]);
Expand Down Expand Up @@ -175,7 +175,7 @@ void AntBms::on_status_data_(const std::vector<uint8_t> &data) {
if (this->supports_new_commands_) {
this->publish_state_(this->power_sensor_, total_voltage * current);
} else {
this->publish_state_(this->power_sensor_, (float) (int) ant_get_32bit(111));
this->publish_state_(this->power_sensor_, (float) (int32_t) ant_get_32bit(111));
}
// 115 0x0D: Cell with the highest voltage Cell 13
this->publish_state_(this->max_voltage_cell_sensor_, (float) data[115]);
Expand Down

0 comments on commit 59c6240

Please sign in to comment.