Fixed special switches and play value, volume & backlight custom functions

This commit is contained in:
Raphael Coeffic
2021-12-31 10:53:11 +01:00
parent 64287e5654
commit af00d03640
2 changed files with 13 additions and 1 deletions
@@ -171,6 +171,11 @@ Node convert<CustomFunctionData>::encode(const CustomFunctionData& rhs)
def += ",";
def += std::to_string(rhs.param);
} break;
case FuncPlayValue:
case FuncVolume:
case FuncBacklight: {
def += YamlRawSourceEncode(RawSource(rhs.param));
} break;
case FuncAdjustGV1: {
// + GV #
def += std::to_string(p1);
@@ -280,6 +285,13 @@ bool convert<CustomFunctionData>::decode(const Node& node,
rhs.func = (AssignFunc)((int)rhs.func + tmr);
def >> rhs.param;
} break;
case FuncPlayValue:
case FuncVolume:
case FuncBacklight: {
std::string src_str;
getline(def, src_str, ',');
rhs.param = YamlRawSourceDecode(src_str).toValue();
} break;
case FuncAdjustGV1: {
// + GV #
int gvar_idx=0;
@@ -68,7 +68,7 @@ std::string YamlRawSwitchEncode(const RawSwitch& rhs)
break;
default:
sw_str += getCurrentFirmware()->getRawSwitchTypesTag(sval);
sw_str += getCurrentFirmware()->getRawSwitchTypesTag(rhs.type);
break;
}
return sw_str;