Remove unused argument from function

This commit is contained in:
Stefano Mazzucco 2019-12-13 16:35:41 +00:00
parent 1a108fcacf
commit 50866566f7
1 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,7 @@ local power_widget = wibox.widget {
widget = wibox.widget.imagebox widget = wibox.widget.imagebox
} }
local function get_percentage(widget) local function get_percentage()
local percentage = device.Percentage local percentage = device.Percentage
if percentage then if percentage then
@ -71,7 +71,7 @@ end
local function maybe_warn(widget, warning_condition, notification_preset) local function maybe_warn(widget, warning_condition, notification_preset)
local warning_level = device.warninglevel or "None" local warning_level = device.warninglevel or "None"
local percentage = get_percentage(widget) local percentage = get_percentage()
if warning_condition then if warning_condition then
local msg = (warning_level.name == "None" and "Low" or warning_level.name) .. " battery!" local msg = (warning_level.name == "None" and "Low" or warning_level.name) .. " battery!"
@ -92,7 +92,7 @@ end
local function update_tooltip(widget) local function update_tooltip(widget)
if device.IsPresent then if device.IsPresent then
local percentage = get_percentage(widget) local percentage = get_percentage()
local charge_status_msg = "" local charge_status_msg = ""
local what local what
local when local when
@ -129,7 +129,7 @@ local function should_warn_critical(widget)
return false return false
end end
local percentage = get_percentage(widget) local percentage = get_percentage()
return ( return (
device.state == power.enums.BatteryState.Discharging and device.state == power.enums.BatteryState.Discharging and
@ -154,7 +154,7 @@ local function update(widget)
maybe_warn( maybe_warn(
widget, widget,
get_percentage(widget) <= widget.warning_config.percentage, get_percentage() <= widget.warning_config.percentage,
widget.warning_config.preset widget.warning_config.preset
) )