You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
are not forwarded to API.get_current_readings. When the number of maxretries is set to 1, it's still 5 due to the default value of 5 in API.get_current_readings. Also the recursive call should not happen in SingleInverter.get_current_readings as it already happens in API.get_current_readings.
Furthermore, the function should return data, but it returns retval set to None.
This is what the function should imho look like:
def get_current_readings(
self,
raw: bool=True,
retry: int=1,
maxretries: int=5,
delay: int=30,
) -> Any:
""" grabs the data and makes sure self.data only has a single inverter """
# update the data
super().get_current_readings(raw, retry, maxretries, delay)
# reduce self.data['inverter'] to a single dict from a list
if self.data.get("inverter"):
self.data["inverter"] = self.data["inverter"][0]
return self.data
The text was updated successfully, but these errors were encountered:
Hi @yaleman,
Thanks! Shouldn’t the if statement stay there? If the API call is not successful, an empty diction is returned and then it will throw an error.
The arguments passed to
SingleInverter.get_current_readings
:pygoodwe/pygoodwe/__init__.py
Line 438 in 96f0872
are not forwarded to
API.get_current_readings
. When the number ofmaxretries
is set to 1, it's still 5 due to the default value of 5 inAPI.get_current_readings
. Also the recursive call should not happen inSingleInverter.get_current_readings
as it already happens inAPI.get_current_readings
.Furthermore, the function should return data, but it returns
retval
set toNone
.This is what the function should imho look like:
The text was updated successfully, but these errors were encountered: