Skip to content

Commit 71e042c

Browse files
committed
Hologram Python SDK v0.7.3 release
1 parent 24a192a commit 71e042c

File tree

7 files changed

+22
-7
lines changed

7 files changed

+22
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# What's New in Hologram Python SDK
22

3+
## v0.7.3
4+
5+
2018-01-04 Hologram <[email protected]>
6+
* Just a bunch of internal tool changes. Happy New Year! :)
7+
38
## v0.7.2
49

510
2017-12-18 Hologram <[email protected]>

Hologram/Cloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from Network import NetworkManager
1414
from Authentication import *
1515

16-
__version__ = '0.7.2'
16+
__version__ = '0.7.3'
1717

1818
class Cloud(object):
1919

Hologram/CustomCloud.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def is_ready_to_send(self):
5858
return self.network is None or self.network.is_connected()
5959

6060
# EFFECTS: Sends the message to the cloud.
61-
def sendMessage(self, message, timeout=SEND_TIMEOUT):
61+
def sendMessage(self, message, timeout=SEND_TIMEOUT, close_socket=True):
6262

6363
try:
6464
if not self.is_ready_to_send():
@@ -79,7 +79,8 @@ def sendMessage(self, message, timeout=SEND_TIMEOUT):
7979

8080
self.logger.info('Sent.')
8181

82-
self.close_send_socket()
82+
if close_socket:
83+
self.close_send_socket()
8384

8485
self.event.broadcast('message.sent')
8586
return resultbuf

Hologram/HologramCloud.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,11 @@ def request_hex_nonce(self):
164164
self.logger.debug("Sending nonce request with body of length %d", len(nonce_request))
165165
self.logger.debug('Send: %s', nonce_request)
166166

167-
self.sock.send(nonce_request)
167+
nonce = super(HologramCloud, self).sendMessage(message=nonce_request,
168+
timeout=10, close_socket=False)
168169
self.logger.debug('Nonce request sent.')
169170

170-
resultbuf_hex = binascii.b2a_hex(self.receive_send_socket(max_receive_bytes=32))
171+
resultbuf_hex = binascii.b2a_hex(nonce)
171172

172173
if resultbuf_hex is None:
173174
raise HologramError('Internal nonce error')

scripts/hologram_send.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ def sendTOTP(args, data, is_sms=False):
7575
hologram = HologramCloud(dict(), authentication_type='totp', network='cellular')
7676
send_message_helper(hologram, args, is_sms=is_sms)
7777

78+
79+
def sendSIMOTP(args, data, is_sms=False):
80+
81+
hologram = HologramCloud(dict(), authentication_type='sim-otp', network='cellular')
82+
send_message_helper(hologram, args, is_sms=is_sms)
83+
7884
# EFFECTS: Parses and sends the specified message using CSRPSK Authentication
7985
def sendPSK(args, data, is_sms=False):
8086

@@ -145,6 +151,8 @@ def run_hologram_send_cloud(args):
145151
data = dict()
146152
if args['authtype'] == 'totp' and not args['devicekey']:
147153
sendTOTP(args, data)
154+
elif args['authtype'] == 'sim-otp':
155+
sendSIMOTP(args, data)
148156
else:
149157
sendPSK(args, data)
150158

tests/MessageMode/test_Cloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ def test_invalid_send_sms(self):
4848
def test_sdk_version(self):
4949
cloud = Cloud(None, send_host = '127.0.0.1', send_port = 9999)
5050

51-
assert cloud.version == '0.7.2'
51+
assert cloud.version == '0.7.3'

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.2
1+
0.7.3

0 commit comments

Comments
 (0)