We have moved at community.getvera.com

Author Topic: Lua require file startup - ALTUI Editor  (Read 640 times)

Offline DesT

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +5/-1
Lua require file startup - ALTUI Editor
« on: August 13, 2016, 08:52:52 am »
guys..

In the startup file, I have
mylua = require("something")

How to be able to edit this file with the editor in ALTUI, like editing the startup file ?
Vera Edge-UI7/Plus-UI7 (2), DSC Partition (5 ) + Zones Sensors(31), Nest thermostat (1) & Protect Fire/CO (3), GE Sw (8 ), GE Dimr (14), FGMS-001 (2), ZW100 (2), RZCS4 (1), AL-DSC11 (1), Aeon HEM 2nd Edition (1), Aeon SSE (5), YRD220-ZW (1), SONOS (6), MyQ Chamberlain (1)
PINE64/openLuup/ALTUI/Rules

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Lua require file startup - ALTUI Editor
« Reply #1 on: August 13, 2016, 09:58:41 am »
Basically, you can't.  This is best done with an external editor or IDA such as emacs or ZeroBraneStudio, depending on your style.

At a pinch, though, (and this is nasty) you could type out the file with this line in the OS command page:

Code: [Select]
cat mylua.lua

Then cut and paste the output into the Test Lua window, do your editing, then finally make it all into a string in the test window and write it back out...

Code: [Select]
local mylua = [[
-- your Lua goes here
]]

local f=io.open ("mylua.lua",'w')
f: write (mylua)
f: close ()

...ghastly, isn't it?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline DesT

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +5/-1
Re: Lua require file startup - ALTUI Editor
« Reply #2 on: August 13, 2016, 10:25:57 am »
I will continue with Notepad++ and SCP ;)
Vera Edge-UI7/Plus-UI7 (2), DSC Partition (5 ) + Zones Sensors(31), Nest thermostat (1) & Protect Fire/CO (3), GE Sw (8 ), GE Dimr (14), FGMS-001 (2), ZW100 (2), RZCS4 (1), AL-DSC11 (1), Aeon HEM 2nd Edition (1), Aeon SSE (5), YRD220-ZW (1), SONOS (6), MyQ Chamberlain (1)
PINE64/openLuup/ALTUI/Rules