-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from fronzbot/dev
0.17.0
- Loading branch information
Showing
17 changed files
with
195 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ build/* | |
docs/_build | ||
*.log | ||
venv | ||
.session* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
"""Login testing script.""" | ||
import sys | ||
import os | ||
from blinkpy.blinkpy import Blink | ||
from blinkpy.auth import Auth | ||
from blinkpy.helpers.util import json_load, json_save | ||
|
||
save_session = False | ||
print("") | ||
print("Blink Login Debug Script ...") | ||
print(" ... Loading previous session information.") | ||
cwd = os.getcwd() | ||
print(f" ... Looking in {cwd}.") | ||
session_path = os.path.join(cwd, ".session_debug") | ||
session = json_load(session_path) | ||
|
||
try: | ||
auth_file = session["file"] | ||
except (TypeError, KeyError): | ||
print(" ... Please input location of auth file") | ||
auth_file = input(" Must contain username and password: ") | ||
save_session = True | ||
|
||
data = json_load(auth_file) | ||
if data is None: | ||
print(f" ... Please fix file contents of {auth_file}.") | ||
print(" ... Exiting.") | ||
sys.exit(1) | ||
|
||
try: | ||
username = data["username"] | ||
password = data["password"] | ||
except KeyError: | ||
print(f" ... File contents of {auth_file} incorrect.") | ||
print(" ... Require username and password at minimum.") | ||
print(" ... Exiting.") | ||
sys.exit(1) | ||
|
||
if save_session: | ||
print(f" ... Saving session file to {session_path}.") | ||
json_save({"file": auth_file}, session_path) | ||
|
||
blink = Blink() | ||
auth = Auth(data) | ||
blink.auth = auth | ||
|
||
print(" ... Starting Blink.") | ||
print("") | ||
blink.start() | ||
print("") | ||
print(" ... Printing login response.") | ||
print("") | ||
print(blink.auth.login_response) | ||
print("") | ||
print(" ... Printing login attributes.") | ||
print("") | ||
print(blink.auth.login_attributes) | ||
print("") | ||
input(" ... Press any key to continue: ") | ||
print(" ... Deactivating auth token.") | ||
blink.auth.token = "foobar" | ||
print(f"\t - blink.auth.token = {blink.auth.token}") | ||
|
||
print(" ... Attempting login.") | ||
print("") | ||
blink.start() | ||
print("") | ||
print(" ... Printing login response.") | ||
print("") | ||
print(blink.auth.login_response) | ||
print("") | ||
print(" ... Printing login attributes.") | ||
print("") | ||
print(blink.auth.login_attributes) | ||
print("") | ||
rint(" ... Done.") | ||
print("") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
black==19.10b0 | ||
coverage==5.3 | ||
coverage==5.4 | ||
flake8==3.8.4 | ||
flake8-docstrings==1.5.0 | ||
pre-commit==2.7.1 | ||
pre-commit==2.10.1 | ||
pylint==2.6.0 | ||
pydocstyle==5.1.1 | ||
pytest==6.1.1 | ||
pytest-cov==2.10.1 | ||
pytest==6.2.2 | ||
pytest-cov==2.11.1 | ||
pytest-sugar==0.9.4 | ||
pytest-timeout==1.4.2 | ||
restructuredtext-lint==1.3.1 | ||
pygments==2.7.1 | ||
restructuredtext-lint==1.3.2 | ||
pygments==2.8.0 | ||
testtools>=2.4.0 |
Oops, something went wrong.