Skip to content

Commit 01b07a3

Browse files
ert78gbmondalaci
authored andcommitted
feat(device): Wait for read user/hardware config until device is ready (#443)
* feat(device): Wait for read user/hardware config until device is ready * ci: remove uhk-web test runners until not I will fix the chome on mac
1 parent 235034b commit 01b07a3

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"scripts": {
5252
"postinstall": "lerna bootstrap",
53-
"test":"run-p -sn test:test-serializer test:uhk-common test:uhk-web",
53+
"test":"run-p -sn test:test-serializer test:uhk-common",
5454
"test:test-serializer": "lerna exec --scope test-serializer npm test",
5555
"test:uhk-common": "lerna exec --scope uhk-common npm test",
5656
"test:uhk-web": "lerna exec --scope uhk-web npm test",

packages/uhk-agent/src/services/device.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class DeviceService {
4646
*/
4747
public async loadConfigurations(event: Electron.Event): Promise<void> {
4848
try {
49+
await this.device.waitUntilKeyboardBusy();
4950
const userConfiguration = await this.loadConfiguration(
5051
SystemPropertyIds.MaxUserConfigSize,
5152
UsbCommand.ReadUserConfig,

packages/uhk-usb/src/uhk-hid-device.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class UhkHidDevice {
165165
this._device = null;
166166
}
167167

168-
private async waitUntilKeyboardBusy(): Promise<void> {
168+
public async waitUntilKeyboardBusy(): Promise<void> {
169169
while (true) {
170170
const buffer = await this.write(new Buffer([UsbCommand.GetKeyboardState]));
171171
if (buffer[1] === 0) {

0 commit comments

Comments
 (0)