Skip to content

Commit

Permalink
Don't decode measurement twice (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Feb 11, 2025
1 parent 8f5e59e commit afb629d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/jk_bms_ble/jk_bms_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ void JkBmsBle::decode_jk02_cell_info_(const std::vector<uint8_t> &data) {
// 122 4 0x00 0x00 0x00 0x00 Battery power 0.001 W
// 126 4 0x00 0x00 0x00 0x00 Charge current 0.001 A
float current = (float) ((int32_t) jk_get_32bit(126 + offset)) * 0.001f;
this->publish_state_(this->current_sensor_, (float) ((int32_t) jk_get_32bit(126 + offset)) * 0.001f);
this->publish_state_(this->current_sensor_, current);

// Don't use byte 122 because it's unsigned
// float power = (float) ((int32_t) jk_get_32bit(122 + offset)) * 0.001f;
Expand Down

0 comments on commit afb629d

Please sign in to comment.