Extend key for external alertable to avoid conflicts with different alerts

This commit is contained in:
Alfredo Cardigliano 2025-08-28 11:44:44 +02:00
parent 6cf11e0e21
commit 16e090549d
5 changed files with 30 additions and 8 deletions

View file

@ -181,6 +181,12 @@ end
-- ##############################################
function Alert:get_subtype()
return self.subtype
end
-- ##############################################
function Alert:set_granularity(granularity)
self.granularity = alert_granularities[granularity]
if (self.granularity == nil) then

View file

@ -372,8 +372,9 @@ function alerts_api.trigger(entity_info, type_info, when, cur_alerts)
triggered = network.storeTriggeredAlert(table.unpack(params))
end
else
triggered = interface.triggerExternalAlert(entity_info.alert_entity.entity_id, entity_info.entity_val,
table.unpack(params))
local key = string.format("%s_%s_%s", entity_info.entity_val, type_info.alert_type.alert_key, subtype)
triggered = interface.triggerExternalAlert(entity_info.alert_entity.entity_id, entity_info.entity_val, key, table.unpack(params))
end
if (triggered == nil) then