add function test_voice
This commit is contained in:
parent
411b2679ef
commit
79b856f448
1
test.py
1
test.py
@ -24,6 +24,7 @@ if conn.get('status'):
|
|||||||
# # level = 'User'
|
# # level = 'User'
|
||||||
# # print "[UID %d]: ID: %s, Name: %s, Level: %s, Password: %s" % ( uid, users[uid][0], users[uid][1], level, users[uid][3] )
|
# # print "[UID %d]: ID: %s, Name: %s, Level: %s, Password: %s" % ( uid, users[uid][0], users[uid][1], level, users[uid][3] )
|
||||||
|
|
||||||
|
print zk.test_voice()
|
||||||
print zk.enable_device()
|
print zk.enable_device()
|
||||||
print 'Disconnecting to device ...'
|
print 'Disconnecting to device ...'
|
||||||
print zk.disconnect()
|
print zk.disconnect()
|
||||||
|
10
zk/base.py
10
zk/base.py
@ -192,6 +192,16 @@ class ZK(object):
|
|||||||
else:
|
else:
|
||||||
return cmd_response
|
return cmd_response
|
||||||
|
|
||||||
|
def test_voice(self):
|
||||||
|
command = const.CMD_TESTVOICE
|
||||||
|
cmd_response = self.__send_command(command)
|
||||||
|
cmd_response['data'] = ''
|
||||||
|
if cmd_response.get('status'):
|
||||||
|
cmd_response['message'] = 'voice detected'
|
||||||
|
return cmd_response
|
||||||
|
else:
|
||||||
|
return cmd_response
|
||||||
|
|
||||||
# def __get_size_user(self):
|
# def __get_size_user(self):
|
||||||
# """Checks a returned packet to see if it returned CMD_PREPARE_DATA,
|
# """Checks a returned packet to see if it returned CMD_PREPARE_DATA,
|
||||||
# indicating that data packets are to be sent
|
# indicating that data packets are to be sent
|
||||||
|
Loading…
Reference in New Issue
Block a user