Skip to content

Commit c4bbe54

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent bdc9a44 commit c4bbe54

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

‎apps/predbat/gecloud.py‎

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ async def async_automatic_config(self, devices):
619619
if not devices or not devices["battery"]:
620620
self.log("GECloud: No battery devices found, cannot configure")
621621
return
622-
622+
623623
batteries = devices["battery"]
624624
num_inverters = len(batteries)
625625

@@ -1095,38 +1095,38 @@ async def async_get_devices(self):
10951095
"battery": list of serials (lowercase) for battery inverters (devices with non-empty batteries)
10961096
10971097
{
1098-
'serial_number': 'xxxx', 'firmware_version': 904, 'type': 'GPRS', 'commission_date': '2025-09-23T00:00:00Z',
1099-
'inverter':
1100-
{'serial': 'xxxx', 'status': 'NORMAL', 'last_online': '2025-09-26T18:28:23Z', 'last_updated': '2025-09-26T18:28:23Z',
1101-
'commission_date': '2024-08-16T00:00:00Z',
1098+
'serial_number': 'xxxx', 'firmware_version': 904, 'type': 'GPRS', 'commission_date': '2025-09-23T00:00:00Z',
1099+
'inverter':
1100+
{'serial': 'xxxx', 'status': 'NORMAL', 'last_online': '2025-09-26T18:28:23Z', 'last_updated': '2025-09-26T18:28:23Z',
1101+
'commission_date': '2024-08-16T00:00:00Z',
11021102
'info': {
1103-
'battery_type': 'LITHIUM',
1104-
'battery': {'nominal_capacity': 52, 'nominal_voltage': 307.2, 'depth_of_discharge': 0.85},
1105-
'model': 'All-In-One', 'max_charge_rate': 6000, 'max_discharge_rate': 6000},
1106-
'warranty': {'type': 'Standard', 'expiry_date': '2036-08-16T00:00:00Z'},
1107-
'firmware_version': {'ARM': 616, 'DSP': 616},
1103+
'battery_type': 'LITHIUM',
1104+
'battery': {'nominal_capacity': 52, 'nominal_voltage': 307.2, 'depth_of_discharge': 0.85},
1105+
'model': 'All-In-One', 'max_charge_rate': 6000, 'max_discharge_rate': 6000},
1106+
'warranty': {'type': 'Standard', 'expiry_date': '2036-08-16T00:00:00Z'},
1107+
'firmware_version': {'ARM': 616, 'DSP': 616},
11081108
'connections': {'batteries': [{'module_number': 1, 'serial': '6568', 'firmware_version': 12, 'capacity': {'full': 52, 'design': 52}, 'cell_count': 96, 'has_usb': False, 'nominal_voltage': 307.2}], 'meters': []}, 'flags': ['full-power-discharge-in-eco-mode']}, 'site_id': 61435}
11091109
{
1110-
'serial_number': 'xxxx', 'firmware_version': 206, 'type': 'GPRS', 'commission_date': '2024-05-24T00:00:00Z',
1111-
'inverter':
1110+
'serial_number': 'xxxx', 'firmware_version': 206, 'type': 'GPRS', 'commission_date': '2024-05-24T00:00:00Z',
1111+
'inverter':
11121112
{'serial': 'xxxx', 'status': 'NORMAL', 'last_online': '2025-09-26T18:28:22Z', 'last_updated': '2025-09-26T18:28:22Z', 'commission_date': '2024-05-24T00:00:00Z',
1113-
'info':
1114-
{'battery_type': 'LITHIUM',
1115-
'battery': {'nominal_capacity': 52, 'nominal_voltage': 307.2, 'depth_of_discharge': 0.85},
1116-
'model': 'All-In-One', 'max_charge_rate': 6000, 'max_discharge_rate': 6000},
1117-
'warranty': {'type': 'Standard', 'expiry_date': '2036-05-29T13:25:55Z'},
1118-
'firmware_version': {'ARM': 616, 'DSP': 616},
1113+
'info':
1114+
{'battery_type': 'LITHIUM',
1115+
'battery': {'nominal_capacity': 52, 'nominal_voltage': 307.2, 'depth_of_discharge': 0.85},
1116+
'model': 'All-In-One', 'max_charge_rate': 6000, 'max_discharge_rate': 6000},
1117+
'warranty': {'type': 'Standard', 'expiry_date': '2036-05-29T13:25:55Z'},
1118+
'firmware_version': {'ARM': 616, 'DSP': 616},
11191119
'connections': {'batteries': [{'module_number': 1, 'serial': '4316', 'firmware_version': 12, 'capacity': {'full': 49.7, 'design': 52}, 'cell_count': 96, 'has_usb': False, 'nominal_voltage': 307.2}], 'meters': []}, 'flags': ['full-power-discharge-in-eco-mode']}, 'site_id': 61435}
11201120
{
1121-
'serial_number': 'xxxx', 'firmware_version': 206, 'type': 'GPRS', 'commission_date': '2024-05-24T00:00:00Z',
1122-
'inverter':
1123-
{'serial': 'xxxx', 'status': 'NORMAL', 'last_online': '2025-09-26T18:28:07Z', 'last_updated': '2025-09-26T18:28:22Z', 'commission_date': '2024-05-24T00:00:00Z',
1124-
'info':
1125-
{'battery_type': 'LEAD_ACID',
1126-
'battery': {'nominal_capacity': 104, 'nominal_voltage': 307.2, 'depth_of_discharge': 0.85},
1127-
'model': 'Gateway', 'max_charge_rate': 12000, 'max_discharge_rate': 12000},
1128-
'warranty': {'type': 'Standard', 'expiry_date': '2036-05-29T13:25:55Z'},
1129-
'firmware_version': {'ARM': 13, 'DSP': 0},
1121+
'serial_number': 'xxxx', 'firmware_version': 206, 'type': 'GPRS', 'commission_date': '2024-05-24T00:00:00Z',
1122+
'inverter':
1123+
{'serial': 'xxxx', 'status': 'NORMAL', 'last_online': '2025-09-26T18:28:07Z', 'last_updated': '2025-09-26T18:28:22Z', 'commission_date': '2024-05-24T00:00:00Z',
1124+
'info':
1125+
{'battery_type': 'LEAD_ACID',
1126+
'battery': {'nominal_capacity': 104, 'nominal_voltage': 307.2, 'depth_of_discharge': 0.85},
1127+
'model': 'Gateway', 'max_charge_rate': 12000, 'max_discharge_rate': 12000},
1128+
'warranty': {'type': 'Standard', 'expiry_date': '2036-05-29T13:25:55Z'},
1129+
'firmware_version': {'ARM': 13, 'DSP': 0},
11301130
'connections': {'datalog': {'serial_number': 'WK2315G357', 'firmware_version': 206, 'type': 'GPRS', 'commission_date': '2024-05-24T00:00:00Z', 'site_id': 61435}, 'batteries': [{'module_number': 1, 'serial': '4316', 'firmware_version': 12, 'capacity': {'full': 49.7, 'design': 52}, 'cell_count': 96, 'has_usb': False, 'nominal_voltage': 307.2}, {'module_number': 1, 'serial': '6568', 'firmware_version': 12, 'capacity': {'full': 52, 'design': 52}, 'cell_count': 96, 'has_usb': False, 'nominal_voltage': 307.2}], 'meters': [{'address': 1, 'serial_number': 2075078, 'manufacturer_code': '3510960161', 'type_code': 33, 'hardware_version': 256, 'software_version': 517, 'baud_rate': 9600}, {'address': 2, 'serial_number': 2021106, 'manufacturer_code': '960823329', 'type_code': 33, 'hardware_version': 256, 'software_version': 517, 'baud_rate': 9600}]}, 'flags': ['full-power-discharge-in-eco-mode', 'is-controllable']}, 'site_id': 61435}
11311131
"""
11321132

@@ -1145,7 +1145,7 @@ async def async_get_devices(self):
11451145
serial = serial.lower()
11461146
if "plant ems" in model:
11471147
result["ems"] = serial
1148-
elif 'gateway' in model:
1148+
elif "gateway" in model:
11491149
result["gateway"] = serial
11501150
elif batteries:
11511151
result["battery"].append(serial)
@@ -1307,7 +1307,7 @@ def download_ge_data(self, now_utc):
13071307
datestr = time_value.strftime("%Y-%m-%d")
13081308
url = "https://api.givenergy.cloud/v1/inverter/{}/data-points/{}".format(geserial, datestr)
13091309
while url:
1310-
if '?' in url:
1310+
if "?" in url:
13111311
url += "&pageSize=4096"
13121312
else:
13131313
url += "?pageSize=4096"
@@ -1338,7 +1338,7 @@ def download_ge_data(self, now_utc):
13381338
new_data["export"] = dexport
13391339
new_data["pv"] = dpv
13401340
mdata.append(new_data)
1341-
#self.log("Info: GECloud downloaded {} data points".format(len(darray)))
1341+
# self.log("Info: GECloud downloaded {} data points".format(len(darray)))
13421342
if not darray:
13431343
url = None
13441344
else:

0 commit comments

Comments
 (0)