Fixes #965
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user