Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ def __init__(self, thing_name, cli, thing, cfg, args=(), kwargs={}):
self.thing_name = thing_name
self.thing = thing
self.root_cert = cli.root_cert
self.topic = cli.topic # do not append thing name to topic for shadow update
if (cli.append_thing_name):
self.topic = '{0}/{1}'.format(cli.topic, self.thing_name)
else:
self.topic = cli.topic # do not append thing name to topic for shadow update

self.region = cli.region
self.cfg = cfg
Expand Down Expand Up @@ -630,6 +633,8 @@ def clean_up(cli):
help="The root certificate for the credentials")
send.add_argument('--topic', dest='topic', default=DEFAULT_TOPIC,
help='The topic to which the message will be sent.')
send.add_argument('--append-thing-name', dest='append_thing_name', default=False,
help='Include the thing name in the topic.')
send.add_argument(
'--duration', dest='duration', type=int, default=10,
help='The messages will be sent once a second for <duration> seconds.')
Expand All @@ -647,6 +652,8 @@ def clean_up(cli):
help="The root certificate for the credentials")
subs.add_argument('--topic', dest='topic', default=DEFAULT_TOPIC,
help='The topic on which to subscribe.')
subs.add_argument('--append-thing-name', dest='append_thing_name', default=False,
help='Include the thing name in the topic.')
subs.add_argument(
'--duration', dest='duration', type=int, default=10,
help='The subscription will listen on the topic for <duration> seconds.')
Expand Down