summaryrefslogtreecommitdiffstats
path: root/provisioning-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'provisioning-model.lua')
-rw-r--r--provisioning-model.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/provisioning-model.lua b/provisioning-model.lua
index 807d08e..fd4c1e4 100644
--- a/provisioning-model.lua
+++ b/provisioning-model.lua
@@ -1257,11 +1257,16 @@ mymodule.update_group = function(self, group, action, create)
-- Update the devices after databasedisconnect so device failure doesn't rollback the change
if success then
+ group.descr = {"Parameter Group Saved"}
-- Notify the devices that their params might have changed (this will also validate)
for i,d in ipairs(devices) do
local r = set_device_params(get_device_params(d.device_id, false), false)
- if r.errtxt then self.logevent("ERROR: Failed to update params for device "..d.device_id.."\n"..r:print_errtxt()) end
+ if r.errtxt then
+ group.descr[#group.descr+1] = "ERROR: Failed to update params for device "..d.device_id.."\n"..r:print_errtxt()
+ self.logevent(group.descr[#group.descr])
+ end
end
+ group.descr = table.concat(group.descr, "\n")
end
end)
if not res and err then
@@ -1442,11 +1447,16 @@ mymodule.update_param = function(self, param, action, create)
-- Update the devices after databasedisconnect so device failure doesn't rollback the change
if success then
+ param.descr = {"Parameter Saved"}
-- Notify the devices that their params might have changed (this will also validate)
for i,d in ipairs(devices) do
local r = set_device_params(get_device_params(d.device_id, false), false)
- if r.errtxt then self.logevent("ERROR: Failed to update params for device "..d.device_id.."\n"..r:print_errtxt()) end
+ if r.errtxt then
+ param.descr[#param.descr+1] = "ERROR: Failed to update params for device "..d.device_id.."\n"..r:print_errtxt()
+ self.logevent(param.descr[#param.descr])
+ end
end
+ param.descr = table.concat(param.descr, "\n")
end
end)
if not res and err then