diff --git a/companion/src/firmwares/edgetx/yaml_rawswitch.cpp b/companion/src/firmwares/edgetx/yaml_rawswitch.cpp index 0b83ea70c..69994ec24 100644 --- a/companion/src/firmwares/edgetx/yaml_rawswitch.cpp +++ b/companion/src/firmwares/edgetx/yaml_rawswitch.cpp @@ -145,6 +145,17 @@ RawSwitch YamlRawSwitchDecode(const std::string& sw_str) rhs.index = sw_idx * 3 + (val[2] - '0' + 1); } + // these types use index = 1 + } else if (val_len > 4 && ( + (val[0] == 'R' && val[1] == 'A' && val[2] == 'D' && val[3] == 'I' && val[4] == 'O') || + (val[0] == 'T' && val[1] == 'E' && val[2] == 'L' && val[3] == 'E' && val[4] == 'M'))) { + + int sw_type = getCurrentFirmware()->getRawSwitchTypesIndex(sw_str_tmp.c_str()); + if (sw_type >= 0) { + rhs.type = (RawSwitchType)sw_type; + rhs.index = 1; + } + // TODO: SWITCH_TYPE_TIMER_MODE // check as it appears to be depreciated as not in RawSwitch data model and not in radio yaml export