Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
flopp999 authored Jan 4, 2024
1 parent aec5a96 commit 4e0fa16
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pycheckwatt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ async def get_fcrd_revenueyear(self):
for each in self.feesyear["FCRD"]:
self.feesyeartotal += each["Revenue"]
if responseyear.status == 200:
loop += 2
retval = True
else:
_LOGGER.error("Obtaining data from URL %s failed with status code %d", self.base_url + endpoint, responseyear.status)
Expand All @@ -398,7 +397,7 @@ async def get_fcrd_revenueyear(self):
return await self.handle_client_error(endpoint, headers, error)
else:
try:
while loop < 2:
while loop < 3:
year_date = datetime.now().strftime("%Y")
to_date = year_date + months[loop+1]
from_date = year_date + months[loop]
Expand Down Expand Up @@ -426,7 +425,7 @@ async def get_fcrd_revenueyear(self):
_LOGGER.error("Obtaining data from URL %s failed with status code %d", self.base_url + endpoint, responseyear.status)
else:
_LOGGER.error("Obtaining data from URL %s failed with status code %d", self.base_url + endpoint, responseyear.status)
return retval
return retval

except (ClientResponseError, ClientError) as error:
return await self.handle_client_error(endpoint, headers, error)
Expand Down Expand Up @@ -488,7 +487,7 @@ async def get_energy_flow(self):

# Define headers with the JwtToken
headers = {
**self._get_headers(),
**self._get_headers(),
"authorization": f"Bearer {self.jwt_token}",
}

Expand Down Expand Up @@ -824,4 +823,3 @@ def battery_soc(self):
_LOGGER.warning("Unable to retrieve Battery SoC")
return None


0 comments on commit 4e0fa16

Please sign in to comment.