update README

This commit is contained in:
Fanani M. Ihsan 2016-06-17 13:54:05 +07:00
parent 685262fab8
commit 93f95e4a73

View File

@ -44,33 +44,52 @@ try:
print ' Password : {}'.format(user.password) print ' Password : {}'.format(user.password)
print ' Group ID : {}'.format(user.group_id) print ' Group ID : {}'.format(user.group_id)
print ' User ID : {}'.format(user.user_id) print ' User ID : {}'.format(user.user_id)
# don't forget to re-enable device
zk.enable_device()
except Exception, e: except Exception, e:
print "Process terminate : {}".format(e) print "Process terminate : {}".format(e)
finally: finally:
if conn: if conn:
# don't forget to re-enable device
zk.disconnect() zk.disconnect()
``` ```
* Connect/Disconnect
```
zk.connect()
zk.disconnect()
```
* Disable/Enable Connected Device
```
zk.disable_device()
zk.enable_device()
```
* Ger Firmware Version * Ger Firmware Version
``` ```
zk.get_firmware_version() zk.get_firmware_version()
``` ```
* Create User * User Operation
``` ```
# Create user
zk.set_user(uid=1, name='Fanani M. Ihsan', privilege=const.USER_ADMIN, password='12345678', group_id='', user_id='123') zk.set_user(uid=1, name='Fanani M. Ihsan', privilege=const.USER_ADMIN, password='12345678', group_id='', user_id='123')
``` # Get all users (will return list of User object)
* Get User
```
users = zk.get_users() users = zk.get_users()
# Delete User
zk.delete_user(uid=1)
```
* Attendance Record
```
# Get attendances (will return list of Attendance object)
attendances = zk.get_attendance()
# Clear attendances record
zk.clear_attendance()
``` ```
* Test voice * Test voice
@ -79,25 +98,19 @@ users = zk.get_users()
zk.test_voice() zk.test_voice()
``` ```
* Shutdown Device * Device Maintenance
``` ```
# shutdown connected device
zk.power_off() zk.power_off()
``` # restart connected device
* Restart
```
zk.restart() zk.restart()
``` ```
# Todo # Todo
* Create better documentation * Create better documentation
* Clear user
* Finger template downloader & uploader * Finger template downloader & uploader
* Get attendance record
* Clear attendance record
* HTTP Rest api * HTTP Rest api
* Create real time api (if possible) * Create real time api (if possible)
* and much more ... * and much more ...