Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 404 handling #65 #57 #66

Merged
merged 1 commit into from Jan 13, 2024
Merged

Fix 404 handling #65 #57 #66

merged 1 commit into from Jan 13, 2024

Conversation

jasonacox
Copy link
Owner

This PR fixes bug in pypowerwall related to API calls and 404 HTTP status codes handling.

Powerwall Firmware version 23.44.0 has eliminated /api/devices/vitals resulting in a 404 response from the Powerwall Gateway (TEG) when this is requested. There is a bug in the pypowerwall code that will treat this 404 like an authentication failure which will result in attempts to log in over and over, eventually hitting the rate limit. This is especially impactful for those using the proxy for things like Powerwall-Dashboard as the rate limit will prohibit other data gathering.

Related issue: #57

Closes #65

if r.status_code == 404:
# API not found or no longer supported
log.debug('ERROR Powerwall API not found at %s' % url)
return None
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A 404 status response for an API call will now result in a None response and log a debug message.

let timerInterval = setInterval(updateCountdown, 1000);
</script>
</body>
</html>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple landing redirect page for pypowerwall.com.

@jasonacox jasonacox merged commit bcdd236 into main Jan 13, 2024
24 checks passed
@jasonacox jasonacox deleted the v0.7.6 branch January 13, 2024 05:56
@jasonacox
Copy link
Owner Author

https://pypi.org/project/pypowerwall/0.7.6/

jasonacox/pypowerwall:0.7.6t39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Critical Bug - 404 HTTP Status Code Handling
1 participant