Get warning_level in maybe_warn only if needed
This commit is contained in:
parent
ca22180049
commit
f469d040fc
|
@ -70,9 +70,9 @@ local function update_icon(widget)
|
|||
end
|
||||
|
||||
local function maybe_warn(widget, warning_condition, notification_preset, message)
|
||||
local warning_level = device.warninglevel or "None"
|
||||
|
||||
if warning_condition then
|
||||
local warning_level = device.warninglevel or power.enums.BatteryWarningLevel.None
|
||||
local msg = message or (warning_level.name == "None" and "Low" or warning_level.name) .. " battery!"
|
||||
|
||||
if notification then
|
||||
|
|
Loading…
Reference in New Issue