Skip to content

Commit

Permalink
Merge pull request #147 from alandtse/ci_fix
Browse files Browse the repository at this point in the history
fix: increase delay for refresh and update message
  • Loading branch information
alandtse committed Feb 14, 2021
2 parents 39d606f + af78a8b commit 7b52bd6
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 7b52bd6

Please sign in to comment.