Skip to content

Commit

Permalink
v0.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonacox committed Feb 26, 2024
1 parent 0ed75fc commit fed5592
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# RELEASE NOTES

## v0.7.8 - Cloud Setup Fix
## v0.7.8 - Cloud Fixes

* Fix enumeration of energy sites during `cloud mode` setup to handle incomplete sites with Unknown names or types by @dcgibbons in https://github.com/jasonacox/pypowerwall/pull/72
* Proxy t41 Updates - Bug fixes for Solar-Only systems using `cloud mode` (see https://github.com/jasonacox/Powerwall-Dashboard/issues/437).

## v0.7.7 - Battery Data and Network Scanner

Expand Down
2 changes: 1 addition & 1 deletion proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10-alpine
WORKDIR /app
RUN pip3 install pypowerwall==0.7.7 bs4
RUN pip3 install pypowerwall==0.7.8 bs4
COPY . .
CMD ["python3", "server.py"]
EXPOSE 8675
9 changes: 7 additions & 2 deletions proxy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ def do_GET(self):
message = message + "</table>\n"
message = message + '\n<p>Page refresh: %s</p>\n</body>\n</html>' % (
str(datetime.datetime.fromtimestamp(time.time())))
elif self.path == '/api/troubleshooting/problems':
message = pw.poll('/api/troubleshooting/problems') or '{"problems": []}'
elif self.path in ALLOWLIST:
# Allowed API Calls - Proxy to Powerwall
message = pw.poll(self.path)
Expand Down Expand Up @@ -494,7 +496,10 @@ def do_GET(self):

self.send_header('Content-type','{}'.format(ftype))
self.end_headers()
self.wfile.write(fcontent)
try:
self.wfile.write(fcontent)
except:
log.debug("Socket broken sending PROXY response to client [doGET]")
return

# Count
Expand All @@ -519,7 +524,7 @@ def do_GET(self):
self.end_headers()
self.wfile.write(bytes(message, "utf8"))
except:
log.error("Socket broken sending response [doGET]")
log.error("Socket broken sending API response to client [doGET]")

with ThreadingHTTPServer((bind_address, port), handler) as server:
if(https_mode == "yes"):
Expand Down
2 changes: 1 addition & 1 deletion pypowerwall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def poll(self, api='/api/site_info/site_name', jsonformat=False, raw=False, recu
return None
if r.status_code == 404:
# API not found or no longer supported
log.debug('ERROR Powerwall API not found at %s' % url)
log.debug('404 Powerwall API not found at %s' % url)
return None
if r.status_code >= 400 and r.status_code < 500:
# Session Expired - Try to get a new one unless we already tried
Expand Down

0 comments on commit fed5592

Please sign in to comment.