Python wrapper for TTLock API
Project description
ttlock.io
Python wrapper for TTLock API
- Register a developer account
https://open.ttlock.com/reg
- Log in
https://open.ttlock.com/login
- Create application:
https://open.ttlock.com/manager/apps/create
- The application needs to be reviewed. After it is reviewed, all the APIs are available.
- Create a user for this application:
$ curl --location --request POST 'https://api.ttlock.com/v3/user/register?clientId=YOUR_APP_CLIENT_ID&clientSecret=YOUR_APP_CLIENTSECRET&username=NEW_NAME_FOR_YOUR_USER&password=NEW_PASS_FOR_YOUR_USER&date=CURRENTMILLIS' \
--header 'Content-Type: application/x-www-form-urlencoded' \
- ATTENTION: you need pass the NEW_PASS_FOR_YOUR_USER with max 32 chars, low case and md5 encrypted
- Test your USER:
- Download TTLock App at your cellphones app store. Log in with your UserName and Pass created on step four. Add your ttlock gateway and locks.
- Get the AccessToken
$ curl --location --request POST 'https://api.ttlock.com/oauth2/token?client_id=YOUR_APP_CLIENT_ID&client_secret=YOUR_APP_CLIENTSECRET&username=NAME_FOR_YOUR_USER_CREATE_ON_LAST_STEP&password=NEW_PASS_FOR_YOUR_USER_CREATE_ON_LAST_STEP&grant_type=password&redirect_uri=https://yourdomain.com/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
- Install and Use
$ pip install ttlockio
$ python3
>>import ttlockwrapper
>>TTLock(clientId=YOUR_CLIENT_ID,accessToken=YOUR_ACCESS_TOKEN).generate_gateways()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.