diff --git a/soliscloud/soliscloud.py b/soliscloud/soliscloud.py
--- a/soliscloud/soliscloud.py
+++ b/soliscloud/soliscloud.py
#
@@ -271,33 +271,35 @@ class SolisCloud:
#
self.printDebug('Returning mocked response')
#
- "stationStatusVo" : {
#
- # Note: The API doc says this is a long
#
- # but, the value returned to a similar call made by the cloud UI is a string
#
- # 1:Online 2:Offline 3:Alarm
#
- "dataTimeStamp" : 1234567891011,
#
- "collectorSn" : "181920",
#
- "series" : "Solis Acme Inverter",
#
+ "stationStatusVo" : {
#
+ # Note: The API doc says this is a long
#
+ # but, the value returned to a similar call made by the cloud UI is a string
#
+ # 1:Online 2:Offline 3:Alarm
#
+ "dataTimeStamp" : 1234567891011,
#
+ "collectorSn" : "181920",
#
+ "series" : "Solis Acme Inverter",
#
@@ -340,36 +342,41 @@ class SolisCloud:
#
self.printDebug('Returning mocked response')
#
- "stationStatusVo" : {
#
- # Note: The API doc says this is a long
#
- # but, the value returned to a similar call made by the cloud UI is a string
#
- "capacityStr": "kWp",
#
- "installerId" : 4567,
#
- "dataTimestamp" : "1683905510946",
#
- "dayEnergyStr" : "kWh",
#
- "batteryTotalDischargeEnergy" : 0,
#
- "batteryTotalChargeEnergy" : 0,
#
- "condTxtD": "Cloudy",
#
+ "stationStatusVo" : {
#
+ # Note: The API doc says this is a long
#
+ # but, the value returned to a similar call made by the cloud UI is a string
#
+ "capacityStr": "kWp",
#
+ "capacityPercent": 0.0,
#
+ "installerId" : 4567,
#
+ "dataTimestamp" : "1683905510946",
#
+ "dayEnergyStr" : "kWh",
#
+ "batteryTotalDischargeEnergy" : 0.0,
#
+ "batteryTotalChargeEnergy" : 0.0,
#
+ "condTxtD": "Cloudy",
#
@@ -559,7 +566,7 @@ if __name__ == "__main__":
#
# TODO: This should eventually be false
#
# but having mock responses is the only way to proceed until I've got
#
config = configFromEnv()
#
soliscloud = SolisCloud(config, debug=DEBUG, mock=MOCK)
#
@@ -575,7 +582,8 @@ if __name__ == "__main__":
#
stations = soliscloud.fetchStationList()
#
- if not stations or "page" not in stations or "records" not in stations['page']:
#
+ # TODO: lets not do this:
#
+ if not stations or "data" not in stations or "page" not in stations['data'] or "records" not in stations['data']['page']:
#
@@ -583,7 +591,7 @@ if __name__ == "__main__":
#
# Now get a list of inverters
#
- for station in stations["page"]["records"]:
#
+ for station in stations["data"]["page"]["records"]:
#
# Get a list of inverters at the station
#
inverters = soliscloud.fetchInverterList(station_id=station['id'])
#
@@ -596,7 +604,7 @@ if __name__ == "__main__":
#
- for inverter in inverters['page']['records']:
#
+ for inverter in inverters['data']['page']['records']:
#
inverter_details = soliscloud.fetchInverterDetail(inverter['id'])
#
print(inverter_details)
#
lp = extractBatteryStats(inverter_details, config)
#
@@ -604,3 +612,5 @@ if __name__ == "__main__":
#
lp_buffer.append(inverter_lp)