edgetx
edgetx copied to clipboard
[LUA API] new function tele.getSensors()
This refers #777
There is getValue() which read also telemetry sensors as telemetry sensors are listed as standard fields. This creates some problems I think @lshems mentioned this but I'm facing this too. What I mean there is no function that returns if telemetry sensors are discovered. With current implementation we have to hardcode sensor value check with given name against nil.
tele.getSensors() would return list (table) of all sensor fields names and actual field IDs or nil if not discovered
Implementation remarks:
- Telemetry sensors are populated as last part of fields' IDs list
- Tele1 field ID (first discovered sensor ID) depends on radio model ie X9D (232), QX7 (228), Xlite (226) etc. Then its 64x3 sets of fields IDs (3 for each telemetry sensor: current value, max value, min value)
More info about above (for most radios) in my OpenTX 2.3 LUA DEV spreadsheet https://docs.google.com/spreadsheets/d/11gRpQhv6LNhfq85o46ClZguxVQ8xOlNwmqPvndQvntk/edit?usp=sharing