syssi / esphome-jk-bms

ESPHome component to monitor and control a Jikong Battery Management System (JK-BMS) via UART-TTL or BLE
Apache License 2.0
403 stars 134 forks source link

Number components state getting published with the wrong value #450

Closed RFDarter closed 3 months ago

RFDarter commented 4 months ago

Model: B2A20S20P old-sytle Hardware Version: V11 H.X Software Version: V11.288H Connection Mode: BLE protocol_version: JK02_24S

All number componets are getting published with the old state

[01:47:02][D][number:054]: 'jk-bms max charge current' - Setting number value
[01:47:02][D][number:113]:   New number value: 120.000000
[01:47:02][D][jk_bms_ble:1132]: Write register: AA.55.90.EB.0C.04.C0.D4.01.00.00.00.00.00.00.00.00.00.00.1F (20)
[01:47:02][D][number:012]: 'jk-bms max charge current': Sending state 19.000000

https://github.com/syssi/esphome-jk-bms/blob/e3c559f6151b6f37e25f51fdd2a1c25071796c9d/components/jk_bms_ble/number/jk_number.cpp#L10C1-L17C4

i guess it is ment to be this->publish_state(value); instead of this->publish_state(state);