fix remove unused `create_callback` parameter
This commit is contained in:
parent
777efffb8a
commit
48b83f444d
7
init.lua
7
init.lua
|
@ -99,8 +99,6 @@ end
|
||||||
-- @tparam table args The arguments table.
|
-- @tparam table args The arguments table.
|
||||||
-- @tparam[opt] widget args.widget_template The widget template to use to
|
-- @tparam[opt] widget args.widget_template The widget template to use to
|
||||||
-- create the widget instance.
|
-- create the widget instance.
|
||||||
-- @tparam[opt] function args.create_callback User defined callback for the
|
|
||||||
-- widget initialization.
|
|
||||||
-- @tparam[opt] string args.device_path Path of the device to monitor.
|
-- @tparam[opt] string args.device_path Path of the device to monitor.
|
||||||
-- @tparam[opt=false] boolean args.use_display_device Should the widget monitor
|
-- @tparam[opt=false] boolean args.use_display_device Should the widget monitor
|
||||||
-- the _display device_?
|
-- the _display device_?
|
||||||
|
@ -111,7 +109,6 @@ end
|
||||||
function battery_widget.new (args)
|
function battery_widget.new (args)
|
||||||
args = gtable.crush({
|
args = gtable.crush({
|
||||||
widget_template = default_template(),
|
widget_template = default_template(),
|
||||||
create_callback = nil,
|
|
||||||
device_path = '',
|
device_path = '',
|
||||||
use_display_device = false
|
use_display_device = false
|
||||||
}, args or {})
|
}, args or {})
|
||||||
|
@ -122,10 +119,6 @@ function battery_widget.new (args)
|
||||||
and upower.Client():get_display_device()
|
and upower.Client():get_display_device()
|
||||||
or battery_widget.get_device(args.device_path)
|
or battery_widget.get_device(args.device_path)
|
||||||
|
|
||||||
if type(args.create_callback) == 'function' then
|
|
||||||
args.create_callback(widget, widget.device)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Attach signals:
|
-- Attach signals:
|
||||||
widget.device.on_notify = function (d)
|
widget.device.on_notify = function (d)
|
||||||
widget:emit_signal('upower::update', d)
|
widget:emit_signal('upower::update', d)
|
||||||
|
|
Loading…
Reference in New Issue