Skip to content

Commit 916da89

Browse files
committed
Hologram Python SDK v0.5.28 release
1 parent 3c94582 commit 916da89

18 files changed

+37
-55
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2017-09-12 Hologram <[email protected]>
2+
* Deprecated enable_inbound flag in HologramCloud constructor.
3+
* Suppress stack traces when user sends a SIGTERM while it's establishing
4+
a connection.
5+
16
2017-09-01 Hologram <[email protected]>
27
* Fixed topic parsing in hologram_send that can cause message body to be
38
empty.

Hologram/Cloud.py

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

17-
__version__ = '0.5.27'
17+
__version__ = '0.5.28'
1818

1919
class Cloud(object):
2020

Hologram/HologramCloud.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class HologramCloud(CustomCloud):
5757
ERR_UNKNOWN: 'Unknown error'
5858
}
5959

60-
def __init__(self, credentials, enable_inbound = True, network = '',
61-
authentication_type = 'csrpsk'):
60+
def __init__(self, credentials, enable_inbound=False, network='',
61+
authentication_type='csrpsk'):
6262
super(HologramCloud, self).__init__(credentials,
6363
send_host=HOLOGRAM_HOST_SEND,
6464
send_port=HOLOGRAM_PORT_SEND,

Hologram/Network/Cellular.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ def getConnectionStatus(self):
4747
def connect(self, timeout = DEFAULT_CELLULAR_TIMEOUT):
4848
self.logger.info('Connecting to cell network with timeout of ' + str(timeout) + ' seconds')
4949
self._enforce_modem_attached()
50-
success = self.modem.connect(timeout = timeout)
50+
51+
success = False
52+
try:
53+
success = self.modem.connect(timeout = timeout)
54+
except KeyboardInterrupt as e:
55+
pass
56+
5157
if success:
5258
self.logger.info('Successfully connected to cell network')
5359
self._connectionStatus = CLOUD_CONNECTED

examples/example-average-max-signal-strength.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
print "* at https://dashboard.hologram.io"
2727
print ""
2828

29-
hologram = HologramCloud(None, enable_inbound=False, network='cellular')
29+
hologram = HologramCloud(None, network='cellular')
3030

3131
sum_RSSI = 0.0
3232
sum_quality = 0.0

examples/example-cellular-send.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
credentials = {'devicekey': device_key}
3232

33-
hologram = HologramCloud(credentials, enable_inbound=False, network='cellular')
33+
hologram = HologramCloud(credentials, network='cellular')
3434

3535
result = hologram.network.connect()
3636
if result == False:

examples/example-hardware-auth.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,19 @@
2626
print "* at https://dashboard.hologram.io"
2727
print ""
2828

29-
credentials = dict()
30-
3129
logging.basicConfig(level=logging.DEBUG, format="%(levelname)s: %(message)s")
3230

33-
hologram = HologramCloud(credentials, authentication_type='sim-otp',
34-
enable_inbound=False, network='cellular')
31+
hologram = HologramCloud(dict(), authentication_type='sim-otp',
32+
network='cellular')
3533

3634
result = hologram.network.connect()
3735
if result == False:
3836
print 'Failed to connect to cell network'
3937

40-
print 'Cloud type: ' + str(hologram)
41-
42-
print 'Network type: ' + str(hologram.network_type)
43-
4438
recv = hologram.sendMessage("one two three!",
4539
topics = ["TOPIC1","TOPIC2"],
4640
timeout = 3)
4741

4842
print 'RESPONSE MESSAGE: ' + hologram.getResultString(recv)
4943

50-
print 'LOCAL IP ADDRESS: ' + str(hologram.network.localIPAddress)
51-
print 'REMOTE IP ADDRESS: ' + str(hologram.network.remoteIPAddress)
52-
5344
hologram.network.disconnect()

examples/example-hologram-cloud-buffered-messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
credentials = {'devicekey': device_key}
3434

35-
hologram = HologramCloud(credentials, enable_inbound=False)
35+
hologram = HologramCloud(credentials)
3636
print ''
3737

3838
hologram.event.broadcast('network.disconnected')

examples/example-hologram-cloud-csrpsk.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,7 @@
2929

3030
credentials = {'devicekey': device_key}
3131

32-
hologram = HologramCloud(credentials, enable_inbound = False)
33-
34-
print 'Hologram SDK version:'
35-
print hologram.version
36-
37-
print ''
38-
print 'Cloud type: ' + str(hologram)
39-
print ''
40-
print 'Network type: ' + hologram.network_type
41-
print ''
32+
hologram = HologramCloud(credentials)
4233

4334
recv = hologram.sendMessage("one two three!",
4435
topics = ["TWO MORE TIMES","TOPIC TOPIC"],

examples/example-hologram-cloud-periodic-send.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,15 @@
3030

3131
credentials = {'devicekey': device_key}
3232

33-
hologram = HologramCloud(credentials, enable_inbound = False)
33+
hologram = HologramCloud(credentials)
3434

35-
print 'Hologram SDK version:'
36-
print hologram.version
37-
38-
print ''
39-
print 'Cloud type: ' + str(hologram)
40-
print ''
41-
print 'Network type: ' + hologram.network_type
42-
print ''
43-
44-
print 'Sending a periodic message every 10 seconds...'
45-
recv = hologram.sendPeriodicMessage(10, 'This is a periodic message',
35+
print 'Sending a periodic message every 30 seconds...'
36+
recv = hologram.sendPeriodicMessage(30, 'This is a periodic message',
4637
topics=['PERIODIC MESSAGES'],
4738
timeout=6)
4839

49-
print 'sleeping for 20 seconds...'
50-
time.sleep(20)
40+
print 'sleeping for 40 seconds...'
41+
time.sleep(40)
5142
print 'waking up!'
5243

5344
hologram.stopPeriodicMessage()

0 commit comments

Comments
 (0)