allow lua apps to keep key/value data in model yaml
Is there an existing issue for this feature request?
- [X] I have searched the existing issues
The problem
apps like "Flight count" elrs-setup, flight-history need to keep data for their operation the data is related to specific model, but currently cannot be kept there over the year workaround where developed:
- keep flight number on GV9
- keep history data on csv file
- keep flight-controller name on csv file
Describe the solution you'd like
Implement key/value, that will be save and retrieve on the yaml file (they do NOT need to be kept on the memory)
write apps properties.
model.appPropertySet(appName, key, value)
Parameters
- appName (string) - the name of the app
- key (string) – name of the property.
- value – value to be set
retrieve app property by name.
app.appPropertyGet(appName, key)
Parameters
- appName (string) - the name of the app
- key (string) – name of the property Return: the value
remove all app properties .
app.appPropertyDelete(appName)
Parameters
- appName (string) - the name of the app Return: the value
Samples:
model.appPropertySet("FlightApp", "flight_count", 25)
local v = model.appPropertyGet("FlightApp", "flight_count")
model.appPropertySet("RF2_Info", "flight_controller_name", "Sab Goblin 700")
local v = model.appPropertyGet("RF2_Info", "flight_controller_name")
model.appPropertySet("RF2_Info", "last_know_image_name", "heli700")
local v = model.appPropertyGet("RF2_Info", "last_know_image_name")
model.appPropertyDelete("RF2_Info")
Something like this is needed to keep LUA scripts settings together with the model.
yes, it will be most welcome we can even keep the flight count in the model
Still wishing...