Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix autoclose bug in Home and add support of virtual close (or not) #153

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tuxity
Copy link

@tuxity tuxity commented Jun 2, 2024

Description:

This PR addresses a bug where HomeKit hangs during the auto-close delay sequence described here

Changelog:

  • Fixed the issue where HomeKit would hang by ensuring the callback is called after handling the autoCloseDelay logic.
  • Added autoCloseVirtual parameter to determine whether to physically toggle the door or handle it virtually during the auto-close delay.

Tests:

on my local setup using npm link

fix #152

@@ -238,15 +241,16 @@ export const setupGarageDoorOpener = (
assignCurrentDoorState(CurrentDoorState.OPEN);
if (autoCloseDelay) {
await waitFor(`${deviceId}.pending`, autoCloseDelay);
assignCurrentDoorState(CurrentDoorState.CLOSED);
const targetDoorState = service.getCharacteristic(Characteristic.TargetDoorState);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would trigger a new emit and re run in .on(CharacteristicEventTypes.SET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GarageDoorOpener and AutoCloseDelay
1 participant