Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to set user pin codes and fix bug with fetching pin codes #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

broglea
Copy link

@broglea broglea commented Jan 21, 2025

Summary

As part of managing a vacation rental I wanted the ability to programmatically set august lock pin codes. Thanks to the APIs documented here https://github.com/jmaxxz/keymaker/blob/master/postman/august.postman_collection.json I was able to implement this.

First we need to perform an update pin operation and then we need to sync the pins to the lock.

Changes

  • Add new api method (set_pin_for_user) which performs both the update and the sync

  • Fix a bug in pin.py I was hitting when initially calling get_pins() due to a missing key. To do this we switch from direct dictionary access to using .get()

    py-august/august/pin.py:20, in Pin.__init__(self, data)
         18 self._updated_at = data["updatedAt"]
         19 self._loaded_date = data["loadedDate"]
    ---> 20 self._access_start_time = data["accessStartTime"]
         21 self._access_end_time = data["accessEndTime"]
         22 self._access_times = data["accessTimes"]
    
    KeyError: 'accessStartTime'
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant