update function is required if you don't want lua errors when not displayed. it can be empty, but since we have one, let's keep it counting ! (#3646)

This commit is contained in:
3djc
2016-07-05 21:55:47 +02:00
committed by Bertrand Songis
parent 49839b712b
commit 53d8a615a0
+5 -1
View File
@@ -14,9 +14,13 @@ local function update(pie, options)
pie.options = options
end
local function background(pie)
pie.counter = pie.counter + 1
end
function refresh(pie)
pie.counter = pie.counter + 1
lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + TEXT_COLOR);
end
return { name="Counter", options=options, create=create, update=update, refresh=refresh }
return { name="Counter", options=options, create=create, update=update, refresh=refresh, background=background }