Destroy notification if device is not discharging

This commit is contained in:
Stefano Mazzucco 2019-12-16 21:25:17 +00:00
parent b26b4c25b0
commit c7f3a2a24d
1 changed files with 7 additions and 0 deletions

View File

@ -158,6 +158,13 @@ local function update(widget)
widget.warning_config.preset
)
if device.state ~= power.enums.BatteryState.Discharging and notification then
naughty.destroy(
notification,
naughty.notificationClosedReason.dismissedByCommand
)
end
end
local function init(widget)