A simple and basic API wrapper for Latch written in Python
# Windows
python -m pip install pyLatch
#Linux/OS X
python3 -m pip install pyLatch
Basic code:
import pyLatch
pyLatch.Latch('APPID', 'APPSECRET')
How to pair:
import pyLatch
latch = pyLatch.Latch('APPID', 'APPSECRET')
resp = latch.pair('pairCode')
# resp = {'data': {'accountId': 'accountID'}}
Obtaining status:
import pyLatch
latch = pyLatch.Latch('APPID', 'APPSECRET')
resp = latch.status('accountID')
# resp = {'data': {'operations': {'APP_ID': {'status': 'on'}}}}
Unpair account:
import pyLatch
latch = pyLatch.Latch('APPID', 'APPSECRET')
resp = latch.unpair('accountID')
# resp = {}
Use custom proxy:
import pyLatch
latch = pyLatch.Latch('APPID', 'APPSECRET')
latch.setProxy('PROXY_HOST', 'PROXY_PORT')