update documentation

This commit is contained in:
Fanani M. Ihsan 2016-05-30 09:29:00 +07:00
parent ff4495e0f7
commit 43a9732fbc

View File

@ -38,21 +38,19 @@ Basic Usage
import zk
from zk import const
conn = False
zk = zk.ZK(ip='192.168.1.201', port=4370, timeout=5)
try:
response = zk.connect()
if response.get('status') is False:
raise Exception(response.get('message'))
conn = zk.connect()
# disable (lock) the device, make sure no activity when process run
zk.disable_device()
# Do another task here
firmware = zk.get_firmware_version()
print 'Firmware Version: : {}'.format(firmware.get('data'))
firmware_version = zk.get_firmware_version()
print 'Firmware Version: : {}'.format(firmware_version)
users = zk.get_users()
if users.get('status'):
for user in users.get('data'):
for user in users:
privilege = 'User'
if user.privilege == const.USER_ADMIN:
privilege = 'Admin'
@ -69,7 +67,7 @@ Basic Usage
except Exception, e:
print "Process terminate : {}".format(e)
finally:
if zk.is_connect:
if conn:
zk.disconnect()
Technical Documentation