Skip to content

Commit c58e2bf

Browse files
added a samll delay between heat off and led brightness coammands since they very very rarely get missed. I'm thinking they write to the device too quickly so on gets eaten
1 parent fe4e023 commit c58e2bf

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/features/workflowEditor/WorkflowButtons.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ export default function WorkFlow() {
211211
const characteristic = getCharacteristic(heatOffUuid);
212212
const buffer = convertToUInt8BLE(0);
213213
await characteristic.writeValue(buffer);
214-
return next();
214+
currentSetTimeouts.push(
215+
setTimeout(() => {
216+
next();
217+
}, 100)
218+
);
215219
};
216220
}
217221
case "wait": {
@@ -234,7 +238,11 @@ export default function WorkFlow() {
234238
const buffer = convertToUInt16BLE(item.payload);
235239
await characteristic.writeValue(buffer);
236240
dispatch(setLEDbrightness(item.payload));
237-
return next();
241+
currentSetTimeouts.push(
242+
setTimeout(() => {
243+
next();
244+
}, 100)
245+
);
238246
};
239247

240248
AddToQueue(blePayload);

0 commit comments

Comments
 (0)