Skip to content

Commit

Permalink
feature: add alarm state to the notification message
Browse files Browse the repository at this point in the history
  • Loading branch information
sbender9 committed Jul 12, 2018
1 parent ead3e26 commit 7f6b724
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function saveJson(app, name, id, json, res)
fs.writeFile(pathForPluginId(app, id, name), JSON.stringify(json, null, 2),
function(err) {
if (err) {
app.debug(err.stack)
app.debug(err.stack)
app.error(err)
res.status(500)
res.send(err)
Expand All @@ -250,6 +250,8 @@ function send_push(app, device, message, path, state)
secretAccessKey: device.secretAccessKey
});

message = `${state.charAt(0).toUpperCase() + state.slice(1)}: ${message}`

aps = { 'aps': { 'alert': {'body': message}, 'sound': 'default' }, 'path': path }

aps["aps"]["category"] = path == "notifications.autopilot.PilotWayPointAdvance"
Expand Down

0 comments on commit 7f6b724

Please sign in to comment.