fix: Companion decode of Act and Telemetry switches (#1708)

This commit is contained in:
Neil Horne
2022-03-20 19:18:30 +10:00
committed by GitHub
parent 610326f216
commit 87a3d2f9e7
@@ -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