Get warning_level in maybe_warn only if needed

This commit is contained in:
Stefano Mazzucco 2019-12-18 10:50:41 +00:00
parent ca22180049
commit f469d040fc
1 changed files with 1 additions and 1 deletions

View File

@ -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