Skip to content

Commit

Permalink
Follow S&C event names, and update for FZ!
Browse files Browse the repository at this point in the history
  • Loading branch information
gstavrinos committed Oct 26, 2017
1 parent d9829cc commit fdf63bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion config/parameters.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
api_url: 'https://dev.encontrol.io/api/'
username: 'gstavrinos'
password: 'test'
installation_id: '00000000-0000-0000-0000-b827eb9a72ca'
installation_id: '00000000-0000-0000-0000-b827eb7eccf3' # FZ
#installation_id: '00000000-0000-0000-0000-b827eb9a72ca' # FPHAG
user_id: 543
sensor_topic: 'snc_sensors/status'
event_topic: 'snc_sensors/events'
Expand Down
21 changes: 11 additions & 10 deletions src/snc.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,17 @@ def init():
jsn = jsn['Events']
cnt = 0
for j in jsn:
event = SnCSensor()
event.id = 'N/A'
event.name = j['Description']
event.status = j['Date']
event.value = 0
events.append(event)
# Add the five latest only, because the json response includes days of events!
cnt += 1
if cnt >= 5:
break
if j['InstallationId'] == installationid:
event = SnCSensor()
event.id = j['InstallationId']
event.name = j['Description']
event.status = j['Date']
event.value = 0
events.append(event)
# Add the ten latest only, because the json response includes days of events!
cnt += 1
if cnt >= 10:
break

msg.header.stamp = rospy.Time.now()
msg.sensors = events
Expand Down

0 comments on commit fdf63bb

Please sign in to comment.