edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

allow lua apps to keep key/value data in model yaml

Open offer-shmuely opened this issue 11 months ago • 2 comments

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")

offer-shmuely avatar Jan 05 '25 21:01 offer-shmuely

Something like this is needed to keep LUA scripts settings together with the model.

frankiearzu avatar Apr 27 '25 15:04 frankiearzu

yes, it will be most welcome we can even keep the flight count in the model

offer-shmuely avatar Apr 27 '25 18:04 offer-shmuely

Still wishing...

offer-shmuely avatar Aug 01 '25 13:08 offer-shmuely