Skip to content

Commit

Permalink
fix: increase delay for refresh and update message
Browse files Browse the repository at this point in the history
With a delay below 10 seconds, it would be a login could be interrupted
by the refresh. Increased to a minimum of 10 seconds.
  • Loading branch information
alandtse committed Feb 14, 2021
1 parent bfaccc7 commit af78a8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions teslajsonpy/teslaproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ async def test_url(
if resp.content_type == "text/html":
text = await resp.text()
if "<noscript>Please enable JavaScript to view the page content." in text:
_LOGGER.debug("WAF discovered.")
_LOGGER.debug("WAF discovered %s times in a row.", self.waf_retry)
self.waf_retry += 1
return return_timer_countdown_refresh_html(
max(30 * (self.waf_retry - self.waf_limit), 120)
if self.waf_retry > self.waf_limit
else random.random() * self.waf_retry,
"Detected Tesla web application firewall block. Please wait and then reload the page or wait for the auto reload.",
else random.random() * self.waf_retry + 10,
f"Detected Tesla web application firewall block #{self.waf_retry}. Please wait and then reload the page or wait for the auto reload.",
)
self.waf_retry = 0
if resp.content_type == "application/json":
Expand Down

0 comments on commit af78a8b

Please sign in to comment.