Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1.62 KB

widget-options.md

File metadata and controls

31 lines (23 loc) · 1.62 KB

Widget Options Constants

There are several option types that can be specified in the widget options table, which are exposed to the user via the Widget Settings menu.

TypeDescription
COLORDisplays a color picker, returns a color flag value
BOOLDisplays a toggle/checkbox, value toggles between 0 and 1
STRINGText input option, limited to 8 characters
TIMERChoice option, lets you pick from available timers
SOURCEChoice option, lets you pick from available sources (i.e. sticks, switches, LS)
VALUENumerical input option, can specify default, min and max value
TEXT_SIZEChoice option, lets you pick from the available text sizes (i.e. small, large)
ALIGNMENTChoice option, lets you pick from available alignment options (i.e. left, center, right)

{% hint style="warning" %} Maximum five options are allowed. {% endhint %}

{% hint style="warning" %} Option variable name's lenght must be 10 characters or less and no spaces. {% endhint %}

Example

-- Create a table with default options
-- Options can be changed by the user from the Widget Settings menu
-- Notice that each line is a table inside { }
local options = {
  { "Source", SOURCE, 1 },
  -- BOOL is actually not a boolean, but toggles between 0 and 1
  { "Boolean", BOOL, 1 },
  { "Value", VALUE, 1, 0, 10},
  { "Color", COLOR, ORANGE },
  { "Text", STRING, "Max8chrs" }
}