Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
offer-shmuely opened this issue Jan 5, 2025 · 0 comments
Open
1 task done

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

offer-shmuely opened this issue Jan 5, 2025 · 0 comments
Labels
enhancement ✨ New feature or request

Comments

@offer-shmuely
Copy link
Contributor

offer-shmuely commented Jan 5, 2025

Is there an existing issue for this feature request?

  • 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 offer-shmuely added the enhancement ✨ New feature or request label Jan 5, 2025
@offer-shmuely offer-shmuely changed the title allow to keep key/value strings in model yaml for lua apps allow lua apps to keep key/value data in model yaml Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant