This commit is contained in:
bsongis
2014-04-14 13:22:09 +02:00
parent a068323df1
commit 255ce4de98
2 changed files with 10 additions and 6 deletions
@@ -86,8 +86,10 @@ class SwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
addConversion(RawSwitch(SWITCH_TYPE_OFF), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ON), val++);
if (!(flags & POPULATE_TIMER_MODES)) {
addConversion(RawSwitch(SWITCH_TYPE_OFF), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ON), val++);
}
if (version < 216) {
// previous "moment" switches
+6 -4
View File
@@ -387,12 +387,14 @@ int ConvertSwitch_215_to_216(int swtch)
return -ConvertSwitch_215_to_216(-swtch);
else if (swtch <= SWSRC_LAST_SWITCH)
return swtch;
else if (swtch > SWSRC_LAST_SWITCH + 32) {
swtch -= (22+32);
if (swtch > SWSRC_ON)
swtch = 0;
return swtch;
}
else {
swtch += (2*4) + (3*6); // 4 trims and 2 * 6-pos added as switches
if (swtch > SWSRC_ON)
swtch -= (22+32+1);
if (swtch > SWSRC_ON)
swtch = SWSRC_ON;
return swtch;
}
}