03.08.2020, 20:45
(This post was last modified: 03.08.2020, 21:04 by Erwin van der Zwart.)
Hi,
That is rather easy to do:
mytable = { mysecondtable = { mythirttable = { final = 'end' } } }
Sample:
See also: https://www.lua.org/pil/2.5.html
BR,
Erwin
That is rather easy to do:
mytable = { mysecondtable = { mythirttable = { final = 'end' } } }
Code:
--or add afterwards
mytable = {}
mytable.mysecondtable = {}
mytable.mysecondtable.mythirttable = {}
mytable.mysecondtable.mythirttable.final = 'end'
log(mytable)
Code:
profiles = {
climate = {
mode = 'comfort',
temperature = 21.3,
fanmode = 1
},
occupation = {
unoccupied = {
cool = 25,
heat = 18
},
occupied = {
cool = 25,
heat = 18
}
},
curtain = {
runtime = 90,
closed = {
hour = 17,
min = 45
},
opened = {
hour = 7,
min = 30
}
},
reserved = 'not used yet'
}
log(profiles)
log(profiles.climate)
log(profiles.curtain.runtime)
BR,
Erwin