Author Topic: LuaTest - A Tool for Testing Scene Lua Code  (Read 27377 times)

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2371
  • Karma: +33/-45
  • Life Moves Pretty Fast....
    • Node Central
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #75 on: November 14, 2017, 11:42:35 am »
 Hi

Yes the code in lua start up is still there..

Code: [Select]
-- lua testing code

local rblt = require("RBLuaTest")
rbLuaTest = rblt.rbLuaTest
luup.register_handler("rbLuaTest","LuaTest")

And running this

http://192.168.1.183:3480/data_request?id=lr_LuaTest

sadly still give me a No Handler error ?
« Last Edit: November 14, 2017, 11:45:08 am by parkerc »

Offline jswim788

  • Hero Member
  • *****
  • Posts: 550
  • Karma: +30/-2
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #76 on: November 14, 2017, 12:36:35 pm »
Do you see anything in the log during the start up that indicates a problem with the code you list?

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2371
  • Karma: +33/-45
  • Life Moves Pretty Fast....
    • Node Central
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #77 on: November 14, 2017, 12:43:43 pm »
Good point (many thanks)

And yes checking the logs there is a huge long list of red, starting with this.

Quote
01   11/14/17 16:30:32.251   LuaInterface::LoadCode: [string "function scene_2()..."]:588: '<eof>' expected near 'end' <0x77457320>
01   11/14/17 16:30:32.379   JobHandler_LuaUPnP::Run cannot start lua with code:
function scene_2()

local host = "192.

I removed the offending code (in a scene) and it is working now, (thanks) although Im surprised I did not get any errors messages via the UI ??

I did not realise that all the lua code i have added - e.g for the start up and the scenes is loaded at once (in bulk) I assumed it was split so you would get an error if either had an issue ?
« Last Edit: November 14, 2017, 04:08:16 pm by parkerc »

Offline jswim788

  • Hero Member
  • *****
  • Posts: 550
  • Karma: +30/-2
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #78 on: November 14, 2017, 05:51:46 pm »
I did not realise that all the lua code i have added - e.g for the start up and the scenes is loaded at once (in bulk) I assumed it was split so you would get an error if either had an issue ?
Need someone else to answer this - I'm not familiar with the detail of the startup sequence.  I just take it for what it is and hunt down errors that I see and fix them...

Offline reneboer

  • Hero Member
  • *****
  • Posts: 1156
  • Karma: +63/-30
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #79 on: November 15, 2017, 08:11:44 am »
Hi Parker,

I think the vera runs by all scene conditions on startup looking at the log file, so if you have LUA in a scene it will probably get loaded at startup. Other code is indeed loaded when needed.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3891
  • Karma: +481/-11
LuaTest 1.7
« Reply #80 on: January 12, 2018, 09:19:31 am »
I have updated LuaTest to work with the new security enhancements planned for Vera 7.27. It should also work with earlier UI versions - including UI5.

The security enhancements do not permit requests in the form: http://<veraip>:3480/data_request....
Instead they must be formatted as: http://<veraip>/port_3480/data_request....

I have updated the user guide to reflect the new format for invoking LuaTest. Apart from this change, LuaTest 1.7 functions in the same way as version 1.6.

To use the new version, download it from the first post in this thread and upload it to Vera as explained in the user guide.
« Last Edit: January 12, 2018, 09:21:28 am by RexBeckett »

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2371
  • Karma: +33/-45
  • Life Moves Pretty Fast....
    • Node Central
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #81 on: January 12, 2018, 09:35:43 am »
Hi @Rex !

Hope youre well.

Thanks for doing that - Ill update my install and have a play with it tonight.

QQ - Does your update also include the colour coding of words that was previously shared ?

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3891
  • Karma: +481/-11
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #82 on: January 12, 2018, 06:57:06 pm »
Hi @Rex !

Hope youre well.

Thanks for doing that - Ill update my install and have a play with it tonight.

QQ - Does your update also include the colour coding of words that was previously shared ?
Hi Chris,

Yes I'm OK, thanks. I updated my version of LuaTest code having realised that the forthcoming changes would have stopped it working. I didn't change anything else.

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2371
  • Karma: +33/-45
  • Life Moves Pretty Fast....
    • Node Central
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #83 on: January 13, 2018, 01:08:47 pm »
Thanks.

As I still do most of my coding/testing on my Vera3 running UI5, that backwards compatibility is always appreciated.

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3891
  • Karma: +481/-11
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #84 on: January 13, 2018, 06:38:08 pm »
Thanks.

As I still do most of my coding/testing on my Vera3 running UI5, that backwards compatibility is always appreciated.
If you recall, Chris, I wrote LuaTest for you and your iPad. :) I've tried to keep it compatible with just about any browser and be UI version agnostic.

I noticed that there were nearly 800 downloads of V1.6 so we seem to have helped a lot of people develop their Lua coding skills.