Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Update to Python3 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions pykevoplus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3.6
"""
This module provides convenient wrappers for controlling Kwikset Kevo locks
"""
Expand Down Expand Up @@ -93,7 +93,7 @@ def GetLocks(username, password):
return locks

def _manage_session(method):
"""
"""
Decorator to handle the HTTP session to mykevo.com
This allows methods in KevoLock to not have to manage auth sessions themselves
"""
Expand Down Expand Up @@ -309,24 +309,9 @@ def __exit__(self, *exc):
if __name__ == "__main__":
from getpass import getpass

user = raw_input("Username: ")
user = input("Username: ")
passwd = getpass("Password: ")

# Scrape the mykevo.com site to find the locks
for kevolock in Kevo.GetLocks(user, passwd):
print repr(kevolock)

# Instantiate locks from IDs
# Get the lock IDs by logging into mykevo.com, click Details for the lock, click Settings, the lock ID is on the right
# front_door_id = "cca7cd1d-c1d5-43ce-a087-c73b974b3529"
# back_door_id = "c60130cd-8139-4688-8ba3-199276a65ad6"
# for lock_id in [front_door_id, back_door_id]:
# kevolock = KevoLock.FromLockID(lock_id, user, passwd)
# print str(kevolock)

# Do multiple operations on a lock using a single session
# kevolock = KevoLock.FromLockID(garage_door_id, user, passwd)
# with KevoLockSession(kevolock):
# kevolock.Unlock()
# kevolock.Lock()

print(repr(kevolock))