Skip to content

Commit

Permalink
cleanup log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ksanislo committed Dec 21, 2018
1 parent 84edf90 commit 45bcd25
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tcc-exporter
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import urllib.request
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.error import HTTPError

VERSION = '0.8.1'
VERSION = '0.8.2'
PREFIX = 'https://mytotalconnectcomfort.com/'
devices = list()

Expand Down Expand Up @@ -52,10 +52,10 @@ class Client(object):
data = self.urlopener.open(request) # actually sign in
decoded = data.read().decode()
if '/portal/Account/LogOff' in decoded:
log('INFO', 'TCC portal login success.')
log('INFO', 'TCC portal login successful.')
self._backoff = 0
else:
log('INFO', 'TCC portal login failure.')
log('INFO', 'TCC portal login failed.')
raise ValueError('login_failure')
except ValueError:
if (self._backoff < self._min_backoff):
Expand All @@ -64,11 +64,11 @@ class Client(object):
self._backoff = self._max_backoff
else:
self._backoff = self._backoff * 2
log('INFO', 'Setting backoff to {0} seconds.'.format(self._backoff))
log('INFO', 'Set login retry delay to {0} seconds.'.format(self._backoff))
except Exception as e:
log('WARNING', '{0} {1}: {2!r}'.format(inspect.currentframe().f_code.co_name, type(e).__name__, e.args))
else:
log('INFO', 'Backoff in effect, login() delayed another {0} seconds.'.format(self._last_login + self._backoff - utc_seconds))
log('INFO', 'Login retry delayed another {0} seconds.'.format(self._last_login + self._backoff - utc_seconds))

def _request(self, path, data={}, headers={}):
if isinstance(data, str):
Expand Down

0 comments on commit 45bcd25

Please sign in to comment.