Skip to content

Commit

Permalink
Merge pull request #573 from prey/fix/loan-exact-time
Browse files Browse the repository at this point in the history
Fix/loan exact time
  • Loading branch information
SoraKenji authored Apr 6, 2022
2 parents bb627b2 + f6c3da1 commit 18c7fd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
7 changes: 0 additions & 7 deletions lib/agent/actions/triggers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,6 @@ exports.sync = (id, err, triggers, stored, cb) => {
if (state == 6) logger.warn('Persisting action for ' + trigger.name);
if (!trigger.persist) trigger.persist = 0;

trigger.automation_actions.forEach((automation, key) => {
if (automation.action.target == 'alert')
automation.action.options.alert_message = automation.action.options.alert_message.replace("'", '');
if (automation.action.target == 'lock')
automation.action.options.lock_message = automation.action.options.lock_message.replace("'", '');
});

var data = {
id: trigger.id,
name: trigger.name,
Expand Down
5 changes: 2 additions & 3 deletions lib/agent/utils/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ var types = {
keys: ['id', 'command', 'target', 'options', 'started_resp', 'started', 'stopped_resp', 'stopped'],
values: (data) => {
return `'${data.id}', '${data.command}', '${data.target}', '${JSON.stringify(
data.options
)}' , 0, 'NULL', 0, 'NULL'`;
data.options).replace(/'/g, "")}' , 0, 'NULL', 0, 'NULL'`;
}
},
geofences: {
Expand All @@ -46,7 +45,7 @@ var types = {
values: (data) => {
return `'${data.id}', '${data.name}', '${data.persist}', '${data.synced_at}', '${
data.last_exec
}', '${JSON.stringify(data.automation_events)}', '${JSON.stringify(data.automation_actions)}'`;
}', '${JSON.stringify(data.automation_events).replace(/'/g, "")}', '${JSON.stringify(data.automation_actions).replace(/'/g, "")}'`;
}
},
keys: {
Expand Down

0 comments on commit 18c7fd2

Please sign in to comment.