Lua using do - end file
-
Hi,
I’ve got the
L_sPhoneUI.lua
file, which is the very basic Vera smartphone UI, and it’s just ado - end
code construct. How do I make that work under OpenLuup?do .. then loads of code here.. end
I’ve tried putting into the normal xml/json plugin space but it does seem to get picked up, as none of the handlers are registered?
-
That’s just it, there is no corresponding Implementation or Device file, it’s just a Lua (do - end) file.
I wasn’t sure if using a single L_ABC1.lua (do-end) file was a known (Vera/Open) luup approach, and thus it would be picked up handled automatically..
As it seems not, what’s would you recommend as the best route for that in openLuup ? E.g should I add a
dofile
orrequire
statement to thestartup
? Or maybe I could create an Implementation file for it, although the iphoneUI seems to be all handler driven, so not sure the value unless I want a device/UI experience..Just curious what others would do..
-
Thanks @akbooer - I tried the following in Lua Startup
dofile ("L_sPhoneUI.lua")
Which has a number of handlers, and associated functions, one of which is..
luup.register_handler("lug_sPhoneRequest","sPhone") luup.register_handler("lug_sPhoneRequest_room","sPhone_room") luup.register_handler("lug_sPhoneRequest_action","sPhone_action") luup.register_handler("lug_sPhoneRequest_job","sPhone_job") luup.register_handler("lug_sPhoneRequest_job_status","sPhone_job_status") luup.register_handler("lug_sPhoneRequest_camimg","sPhone_camimg") luup.register_handler("lug_sPhoneRequest_action_js","sPhone_action_js")
When I try
192.168.1.234:3480/data_request?id=lr_sPhone
it still returnsNo handler for data_request?id=lr_sPhone
The actual L_sPhoneUI.lua file, is the only ‘ Smartphone Web Interface ’ file that’s installed via the mios App Store ..
-
Ok, seems to be working now, and it now provides me with an alternative (very basic) UI for OpenLuup.
Plus for my plug-ins I can use this to create more kiosk type interfaces for OpenLuup.. e.g.
https://smarthome.community/topic/813/openluup-kiosk-touchscreen-idea/5?_=1646900153582