Add check for periodic scripts changing the interface

This commit is contained in:
Alfredo Cardigliano 2023-07-13 16:14:10 +02:00
parent 55df85e4e0
commit 2ff83bcdc3
4 changed files with 14 additions and 6 deletions

View file

@ -406,20 +406,22 @@ function alerts_api.release(entity_info, type_info, when, cur_alerts)
if(entity_info.alert_entity.entity_id == alert_consts.alertEntity("interface")) then
if(interface.checkContext(entity_info.entity_val) == false) then
alertErrorTraceback("Invalid interface entity value detected for entity id "..entity_info.alert_entity.entity_id)
alertErrorTraceback("Invalid interface context detected for entity id "..entity_info.alert_entity.entity_id)
tprint(entity_info)
return(false)
else
released = interface.releaseTriggeredAlert(table.unpack(params))
end
elseif(entity_info.alert_entity.entity_id == alert_consts.alertEntity("network")) then
if(network.checkContext(entity_info.entity_val) == false) then
alertErrorTraceback("Invalid network entity value detected for entity id "..entity_info.alert_entity.entity_id)
alertErrorTraceback("Invalid network context detected for entity id "..entity_info.alert_entity.entity_id)
tprint(entity_info)
return(false)
else
released = network.releaseTriggeredAlert(table.unpack(params))
end
else
released = interface.releaseExternalAlert(entity_info.alert_entity.entity_id, entity_info.entity_val, table.unpack(params))
end