Skip to content

Commit

Permalink
Merge pull request #61 from gtdiehl/master
Browse files Browse the repository at this point in the history
Return None for Inverter data for Envoy with <3.9 firmware
  • Loading branch information
gtdiehl authored Dec 28, 2020
2 parents e993bd7 + cd1b420 commit 38dfc62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions envoy_reader/envoy_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ async def getData(self):
response.raise_for_status()
break
break
if(i == 2):
raise httpx.RemoteProtocolError(message='Malformed request. Failed after 3 retries.', request=None)
if(i == 2):
raise httpx.RemoteProtocolError(message='Malformed request. Failed after 3 retries.', request=None)

async def detect_model(self):
"""Method to determine if the Envoy supports consumption values or
Expand Down Expand Up @@ -374,7 +374,7 @@ async def inverters_production(self):

"""Only return data if Envoy supports retrieving Inverter data"""
if self.endpoint_type == "P0":
return "Inverter data not available for your Envoy device."
return None

response_dict = {}
try:
Expand Down Expand Up @@ -416,6 +416,8 @@ def run_in_console(self):
print("lifetime_consumption: {}".format(results[7]))
if "401" in str(dataResults):
print("inverters_production: Unable to retrieve inverter data - Authentication failure")
elif results[8] is None:
print("inverters_production: Inverter data not available for your Envoy device.")
else:
print("inverters_production: {}".format(results[8]))

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="envoy_reader",
version="0.18.2",
version="0.18.3",
author="Jesse Rizzo",
author_email="[email protected]",
description="A program to read from an Enphase Envoy on the local network",
Expand Down

0 comments on commit 38dfc62

Please sign in to comment.