Added device connection/disconnection alert (#6801)

This commit is contained in:
MatteoBiscosi 2022-08-05 10:46:13 +02:00
parent ad7a312249
commit d6471d8dac
15 changed files with 105 additions and 116 deletions

View file

@ -1004,6 +1004,16 @@ local function validateMac(p)
end
end
-- ##############################################
-- @brief Returns true if inputstr is a Mac or all string
local function validateDeviceOrAll(inputstr)
return (validateMac(inputstr) or inputstr == 'all')
end
http_lint.validateDeviceOrAll = validateDeviceOrAll
-- ##############################################
local function validateZoom(zoom)
if string.match(zoom, "%d+%a") == zoom then
return true
@ -1558,6 +1568,9 @@ local known_parameters = {
["delete_alerts"] = validateBool,
["alert_generation"] = { jsonCleanup, validateJSON },
-- EXCLUDE DEVICES
["device"] = validateDeviceOrAll,
-- UI TOASTS
["toast_id"] = validateSingleWord,