Modules¶
Modules are used in Smart Glasses.
You may access all modules via smartglasses.modules.
Alternatively, you can access them via peripheral.wrap('back') (not recommended).
List all modules:
1 2 3 4 5 | |
Use specific module:
1 2 3 4 5 6 7 | |
Note
It is recommend to locate module by its full ID (e.g. smartglasses.modules['advancedperipherals:overlay']),
instead of using alias (e.g. smartglasses.modules.overlay). Due to alias may sliently conflict with other addons.
Alias is best being used during temperatory test and/or in the interactive Lua shell.
Events¶
glasses_module¶
Fires when a glasses module is attached.
Values:
id: stringThe id of the module
1 2 | |
glasses_module_detach¶
Fires when a glasses module is detached.
Values:
id: stringThe id of the module
1 2 | |
Functions¶
These functions exist on all modules.
getId¶
getId() -> string
Returns the module's ID.
getAlias¶
getAlias() -> string | nil
Returns the module's alias name, if have one.