Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Apr 13, 2023
1 parent 5f3fc34 commit 534c483
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions etc/dbus-serialbattery/dbus-serialbattery.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from daly import Daly
from ant import Ant
from jkbms import Jkbms
from jkbms_ble import Jkbms_Ble

# from sinowealth import Sinowealth
from renogy import Renogy
Expand Down
10 changes: 5 additions & 5 deletions etc/dbus-serialbattery/jkbms_ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Jkbms_Ble(Battery):
resetting = False

def __init__(self, port, baud, address):
super(Jkbms_Ble, self).__init__(address.replace(":", "").lower(), baud)
super(Jkbms_Ble, self).__init__(address.replace(":", "").lower(), baud, address)
self.type = self.BATTERYTYPE
self.jk = JkBmsBle(address)

Expand Down Expand Up @@ -43,10 +43,10 @@ def test_connection(self):
logger.error("no BMS found at " + self.jk.address)
return False


"""
# before indipended service, has to be checked
logger.info("test of jkbmsble")
tries = 0
while True:
Expand Down Expand Up @@ -165,7 +165,7 @@ def refresh_data(self):
self.balancing = False if st["cell_info"]["balancing_action"] == 0.000 else True
self.balancing_current = (
st["cell_info"]["balancing_current"]
if st["cell_info"]["balancing_current"] < 32768
if st["cell_info"]["balancing_current"] < 32768
else ( 65536/1000 - st["cell_info"]["balancing_current"] ) * -1
)
self.balancing_action = st["cell_info"]["balancing_action"]
Expand All @@ -174,7 +174,7 @@ def refresh_data(self):
for c in range(self.cell_count):
if self.balancing and (
st["cell_info"]["min_voltage_cell"] == c
or st["cell_info"]["max_voltage_cell"] == c
or st["cell_info"]["max_voltage_cell"] == c
):
self.cells[c].balance = True
else:
Expand Down

0 comments on commit 534c483

Please sign in to comment.