Fixed scope bugs
This commit is contained in:
@ -64,7 +64,7 @@ function P:set_tooltip(text)
|
||||
end
|
||||
|
||||
function P:new()
|
||||
widget = {
|
||||
local widget = {
|
||||
state = "error"
|
||||
}
|
||||
setmetatable(widget, self)
|
||||
|
@ -3,7 +3,9 @@ local widget_types = {
|
||||
prog = require("classes/battery/prog_widget")
|
||||
}
|
||||
|
||||
local P = {}
|
||||
local P = {
|
||||
name = "battery"
|
||||
}
|
||||
|
||||
|
||||
---
|
||||
@ -51,7 +53,7 @@ end
|
||||
function P:_check_notification()
|
||||
if not self.charging then
|
||||
for i=1, #self.warnings do
|
||||
v = self.warnings[i]
|
||||
local v = self.warnings[i]
|
||||
if (self.battery_percent <= v) and (not self._warning_log[i]) then
|
||||
self._warning_log[i] = true
|
||||
|
||||
@ -83,7 +85,7 @@ end
|
||||
---
|
||||
function P:new(args)
|
||||
-- Arguments
|
||||
b = {
|
||||
local b = {
|
||||
update_interval = args.update_interal or 5,
|
||||
widget_type = args.widget_type or "arc",
|
||||
warnings = {5, 10, 25, 50}, -- Percentages to warn at (must be in order)
|
||||
|
@ -46,7 +46,7 @@ function P:set_tooltip(text)
|
||||
end
|
||||
|
||||
function P:new()
|
||||
widget = {
|
||||
local widget = {
|
||||
state = "error"
|
||||
}
|
||||
setmetatable(widget, self)
|
||||
|
Reference in New Issue
Block a user