Add cloud broker host in case of disconnection and reconnection

This commit is contained in:
Alfredo Cardigliano 2024-07-04 16:42:46 +00:00
parent 5f00c126ea
commit 39494e3002
5 changed files with 28 additions and 12 deletions

View file

@ -30,11 +30,13 @@ alert_cloud_disconnected.meta = {
-- @brief Prepare an alert table used to generate the alert
-- @return A table with the alert built
function alert_cloud_disconnected:init()
function alert_cloud_disconnected:init(description)
-- Call the parent constructor
self.super:init()
self.alert_type_params = {}
self.alert_type_params = {
description = description
}
end
-- #######################################################
@ -45,7 +47,10 @@ end
-- @param alert_type_params Table `alert_type_params` as built in the `:init` method
-- @return A human-readable string
function alert_cloud_disconnected.format(ifid, alert, alert_type_params)
return(i18n("cloud.disconnected"))
local message = i18n("cloud.disconnected")
if not isEmptyString(alert_type_params.description) then
message = message .. " (" .. alert_type_params.description .. ")"
end
end
-- #######################################################