This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Internal database structure
#1
Hi
Do you have a documentation to LM internal object database?
I need to do a few bulk changes like change of icons, classes etc.

Thank you
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#2
It's not documented because most users don't need to change anything there directly and there's no guarantee that there are no breaking changes between firmware releases. Smile
Reply
#3
I've > 100 visualisation windows and I need to do some changes in every of these 100 windows and I don't want to spend 3 days by monkey work. In case the structure is not accessible. Could you please send me commands which:
1. Change every custom name from "lignt - grightness" to "light"
2. Change every default icon from "weather-night-A0F007-010101.svg" to "my_weather_icon.svg"
2. Change every Additional icon from "bulb-A0F007-010101.svg" to "my_lights_on_icon.svg"

Thank you
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#4
Try this, just make sure to make a backup beforehand Smile
Code:
oldname = 'lignt - grightness'
newname = 'light'
db:query('UPDATE visobjects SET name=? WHERE name=?', newname, oldname)

oldicon = 'weather-night-A0F007-010101.svg'
newicon = 'my_weather_icon.svg'
db:query('UPDATE visobjects SET params=replace(params,?,?)', oldicon, newicon)

oldicon = 'bulb-A0F007-010101.svg'
newicon = 'my_lights_on_icon.svg'
db:query('UPDATE visobjects SET params=replace(params,?,?)', oldicon, newicon)
Reply
#5
Thank you. It works perfectly!
It would be great to know a complete database structure but I understand reasons why you don't want to make it public.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#6
Database is in SQLite format, you can extract it from the backup archive and view the whole structure and data.
Reply
#7
Do you know admin or other user if there is a command for showing main structure(to check it without using other program)?

I know such programs but checking the structure with LUA would be very useful
Reply
#8
Code:
log(db:getlist('SELECT sql FROM sqlite_master'))
Reply
#9
Perfect, thank you
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply


Forum Jump: