summaryrefslogtreecommitdiff
path: root/src/ui/ui_fsm.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-04-24 16:06:10 +1000
committerjacqueline <me@jacqueline.id.au>2024-04-24 16:06:10 +1000
commit920345b940bb3993c389d9e9be1a75a8041d431d (patch)
tree562e53906a14c31ba8a21b3c2ae64c652a16acb4 /src/ui/ui_fsm.cpp
parent531475e3511e9c722677d3a351b51d4a579876df (diff)
downloadtangara-fw-920345b940bb3993c389d9e9be1a75a8041d431d.tar.gz
Support getting a tree of controls + hooks via lua
Diffstat (limited to 'src/ui/ui_fsm.cpp')
-rw-r--r--src/ui/ui_fsm.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ui/ui_fsm.cpp b/src/ui/ui_fsm.cpp
index ceeb194d..1cbf1be4 100644
--- a/src/ui/ui_fsm.cpp
+++ b/src/ui/ui_fsm.cpp
@@ -14,6 +14,7 @@
#include "db_events.hpp"
#include "device_factory.hpp"
#include "display_init.hpp"
+#include "esp_spp_api.h"
#include "feedback_haptics.hpp"
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
@@ -497,10 +498,13 @@ void Lua::entry() {
{"brightness", &sDisplayBrightness},
});
- registry.AddPropertyModule("controls", {
- {"scheme", &sInput->mode()},
- {"lock_switch", &sLockSwitch},
- });
+ registry.AddPropertyModule(
+ "controls",
+ {
+ {"scheme", &sInput->mode()},
+ {"lock_switch", &sLockSwitch},
+ {"hooks", [&](lua_State* L) { return sInput->pushHooks(L); }},
+ });
if (sDeviceFactory->touch_wheel()) {
registry.AddPropertyModule(