Skip to content

Commit

Permalink
make home work a bit better
Browse files Browse the repository at this point in the history
  • Loading branch information
gtalusan committed Sep 2, 2024
1 parent eb482a7 commit 1316672
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
"typescript-eslint": "^8.0.1"
},
"dependencies": {
"@george.talusan/eufy-robovac-js": "^0.0.4"
"@george.talusan/eufy-robovac-js": "^0.0.5"
}
}
6 changes: 5 additions & 1 deletion src/defaultAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ interface RobovacEvent {
value: boolean | number | string | object | null;
};

const sleep = (ms: number) => new Promise(r => setTimeout(r, ms));

export class DefaultPlatformAccessory {
private service: Service;

Expand Down Expand Up @@ -83,7 +85,9 @@ export class DefaultPlatformAccessory {
if (on) {
await this.platform.robovac.clean();
} else {
await this.platform.robovac.goHome();
await this.platform.robovac.pause();
await sleep(3000);
await this.platform.robovac.goHome(true);
}
} catch (error: unknown) {
this.platform.log.error(error as string);
Expand Down

0 comments on commit 1316672

Please sign in to comment.