Skip to content

Commit 7812f30

Browse files
authored
fix: name '_credentialFile' is not defined (#84)
This fixes an issue when CLIENT_ID, CLIENT_SECRET and REFRESH_TOKEN are passed, or available from the environment.
1 parent fa8700b commit 7812f30

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lnetatmo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,9 @@ def renew_token(self):
254254
cred = {"CLIENT_ID":self._clientId,
255255
"CLIENT_SECRET":self._clientSecret,
256256
"REFRESH_TOKEN":self.refreshToken }
257-
with open(self._credentialFile, "w") as f:
258-
f.write(json.dumps(cred, indent=True))
257+
if hasattr(type(self), "_credentialFile"):
258+
with open(self._credentialFile, "w") as f:
259+
f.write(json.dumps(cred, indent=True))
259260
self._accessToken = resp['access_token']
260261
self.expiration = int(resp['expire_in'] + time.time())
261262

0 commit comments

Comments
 (0)