https://github.com/lwestenberg/bold_smart_lock
This package implements the Bold Smart Lock API to authenticate and unlock a Bold smart lock. Usage of this API requires a Bold Connect.
https://github.com/lwestenberg/bold_smart_lock
Last synced: 4 months ago
JSON representation
This package implements the Bold Smart Lock API to authenticate and unlock a Bold smart lock. Usage of this API requires a Bold Connect.
- Host: GitHub
- URL: https://github.com/lwestenberg/bold_smart_lock
- Owner: lwestenberg
- License: mit
- Created: 2021-11-07T21:27:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-31T09:18:49.000Z (about 2 years ago)
- Last Synced: 2024-10-28T16:11:36.607Z (4 months ago)
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 11
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bold Smart Lock Python Package
This package implements the Bold Smart Lock API to authenticate and unlock a Bold smart lock. Usage of this API requires a Bold Connect.## Installation
To install dependencies during development run ```pip install .``` from the project directory.
Optionally use the included VSCode Dev Container to get a preconfigured envirionment.## Usage
```python
import asyncio
import aiohttp
from bold_smart_lock.auth import AbstractAuthfrom bold_smart_lock.bold_smart_lock import BoldSmartLock
class TestAuth(AbstractAuth):
async def async_get_access_token(self) -> str:
return "00000000-0000-0000-0000-000000000000" # Obtain an access token with oAuth2 and specify it hereasync def main():
async with aiohttp.ClientSession() as session:
auth = TestAuth(session)
bold = BoldSmartLock(auth)# Get the devices and device permissions
get_device_permissions_response = await bold.get_device_permissions()
print(get_device_permissions_response)# Activate the smart lock by device id
remote_activation_response = await bold.remote_activation(12345)
print(remote_activation_response)# Deactivate the smart lock by device id
remote_deactivation_response = await bold.remote_deactivation(12345)
print(remote_deactivation_response)asyncio.run(main())
```