-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbms_dummy.py
40 lines (32 loc) · 947 Bytes
/
bms_dummy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from bms import BMS
class BMS_DUMMY(BMS):
def __init__(self, port, timeout):
super().__init__()
# optional (showed in ui but not used in control loop)
self._pack_u = []
self._pack_i = []
self._pack_t = []
self._pack_soc = []
self._pack_cycle = []
def update(self):
# read data from BMS and set values
# self._voltage = ...
pass
def get_state(self):
return {
'u': self._voltage,
'i': self._current,
't': self._temperature,
'soc': self._soc,
'soc_low': self._soc_low,
'soc_high': self._soc_high,
'pack_u': self._pack_u,
'pack_i': self._pack_i,
'pack_t': self._pack_t,
'pack_soc': self._pack_soc,
'pack_cycle': self._pack_cycle,
# ...
}
def get_detail(self):
return {
}