Skip to content

Commit

Permalink
Added correct service_id for this service.
Browse files Browse the repository at this point in the history
  • Loading branch information
craig8 committed Oct 4, 2019
1 parent 0c6668c commit 2bbc1c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sensor_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,22 @@ def get_opts():
raise SystemExit

user_options = opts.request['service_configs'][0]['user_options']
service_id = "gridappsd-sensor-simulator"

gapp = GridAPPSD(username=opts.username,
password=opts.password,
address=opts.address)

read_topic = simulation_output_topic(opts.simulation_id)
write_topic = service_output_topic("sensors", opts.simulation_id)
write_topic = service_output_topic(service_id, opts.simulation_id)

log_file = "/tmp/gridappsd_tmp/{}/sensors.log".format(opts.simulation_id)
if not os.path.exists(os.path.dirname(log_file)):
os.makedirs(os.path.dirname(log_file))

with open(log_file, 'w') as fp:
logging.basicConfig(stream=fp, level=logging.INFO)
logging.getLogger().info(f"read topic: {read_topic}\nwrite topic: {write_topic}")
logging.getLogger().info(f"user options: {user_options}")
run_sensors = Sensors(gapp, read_topic=read_topic, write_topic=write_topic,
user_options=user_options)
Expand Down

0 comments on commit 2bbc1c2

Please sign in to comment.