Skip to main content

Python wrapper for TTLock API

Project description

ttlock.io

Python wrapper for TTLock API

  1. Register a developer account
https://open.ttlock.com/reg
  1. Log in
https://open.ttlock.com/login
  1. Create application:
https://open.ttlock.com/manager/apps/create
  • The application needs to be reviewed. After it is reviewed, all the APIs are available.
  1. 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
  1. 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.
  1. 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' \
  1. Install and Use
$ pip install ttlockio 
$ python3
>>import ttlockwrapper
>>TTLock(clientId=YOUR_CLIENT_ID,accessToken=YOUR_ACCESS_TOKEN).get_gateway_generator()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ttlockio-0.1.2.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page