Compare commits
1 Commits
develop
...
a1d7a7452a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1d7a7452a |
@@ -14,7 +14,7 @@ const deviceUsesPrograms = function(device) {
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device.programs != undefined && device.programs.programs != undefined && device.programs.programs.programs != undefined) { return true; }
|
if (device.programs != undefined) { return true; }
|
||||||
if (device.programs == undefined && device.slots == undefined) { return true; }
|
if (device.programs == undefined && device.slots == undefined) { return true; }
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -33,7 +33,7 @@ const deviceUsesSlots = function(device) {
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device.slots != undefined && device.slots.slots != undefined && device.slots.slots.slots != undefined) { return true; }
|
if (device.slots != undefined) { return true; }
|
||||||
if (device.programs == undefined && device.slots == undefined) { return true; }
|
if (device.programs == undefined && device.slots == undefined) { return true; }
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -70,22 +70,22 @@ const getRequestToDo = async function (msn) {
|
|||||||
///// Programs
|
///// Programs
|
||||||
if (child.programmingTimestamp != undefined && deviceUsesPrograms(child)) {
|
if (child.programmingTimestamp != undefined && deviceUsesPrograms(child)) {
|
||||||
timestamp = child.programmingTimestamp || -1
|
timestamp = child.programmingTimestamp || -1
|
||||||
if ((device.programs == undefined) || (timestamp > device.programs.timestamp)) { todo.programs = 2 }
|
if ((device.programs == undefined) || (timestamp < device.programs.timestamp)) { todo.programs = 1 }
|
||||||
else if (timestamp < device.programs.timestamp) { todo.programs = 1 }
|
else if (timestamp > device.programs.timestamp) { todo.programs = 2 }
|
||||||
}
|
}
|
||||||
|
|
||||||
///// Configuration
|
///// Configuration
|
||||||
if (child.configurationTimestamp != undefined) {
|
if (child.configurationTimestamp != undefined) {
|
||||||
timestamp = child.configurationTimestamp || child.relayConfigurationTimestamp || -1
|
timestamp = child.configurationTimestamp || child.relayConfigurationTimestamp || -1
|
||||||
if ((device.configuration == undefined) || (timestamp > device.configuration.timestamp)) { todo.configuration = 2 }
|
if ((device.configuration == undefined) || (timestamp < device.configuration.timestamp)) { todo.configuration = 1 }
|
||||||
else if (timestamp < device.configuration.timestamp) { todo.configuration = 1 }
|
else if (timestamp > device.configuration.timestamp) { todo.configuration = 2 }
|
||||||
}
|
}
|
||||||
|
|
||||||
///// Slots
|
///// Slots
|
||||||
if (child.programmingTimestamp != undefined && deviceUsesSlots(child)) {
|
if (child.programmingTimestamp != undefined && deviceUsesSlots(child)) {
|
||||||
timestamp = child.programmingTimestamp || -1
|
timestamp = child.programmingTimestamp || -1
|
||||||
if ((device.slots == undefined) || (timestamp > device.slots.timestamp)) { todo.slots = 2 }
|
if ((device.slots == undefined) || (timestamp < device.slots.timestamp)) { todo.slots = 1 }
|
||||||
else if (timestamp < device.slots.timestamp) { todo.slots = 1 }
|
else if (timestamp > device.slots.timestamp) { todo.slots = 2 }
|
||||||
}
|
}
|
||||||
|
|
||||||
///// Status
|
///// Status
|
||||||
|
|||||||
Reference in New Issue
Block a user