Skip to content

Re-implemented instanceDenylist. #34

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

Open
wants to merge 1 commit into
base: beta-4.0.3
Choose a base branch
from

Conversation

banboobee
Copy link

This PR re-implements instanceDenylist in #27 more efficiently. May be this is originally intended.

@NorthernMan54 NorthernMan54 requested a review from Copilot July 2, 2025 12:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors how the instance denylist is handled by removing the class-level instanceBlacklist, assigning the list directly on the config object, and dropping the pre-filter step for denied instances.

  • Eliminated instanceBlacklist property from Hap class.
  • Moved denylist assignment from this.instanceBlacklist to config.instanceBlacklist.
  • Removed the service-filtering line that applied the denylist.
Comments suppressed due to low confidence (2)

src/hap.ts:339

  • Removing the service filter means the denylist is no longer applied—instances in config.instanceDenylist will slip through. Re-add a filter using config.instanceBlacklist (or a class property) after loading services to enforce the denylist.
      services = services.filter(x => this.types[x.type] !== undefined);

src/hap.ts:124

  • [nitpick] Mixing instanceDenylist and instanceBlacklist names can confuse readers. Consider standardizing on one term (e.g., rename config.instanceDenylist to config.instanceBlacklist in config schema and docs).
    config.instanceBlacklist = config.instanceDenylist || [];

@NorthernMan54 NorthernMan54 self-requested a review July 4, 2025 12:57
@banboobee
Copy link
Author

@NorthernMan54

For your reference,

hap-client has an instance excluding function.

https://github.com/homebridge/hap-client/blob/1cc6a521f14a006d8dc378e5c206c5dc7312293a/src/index.ts#L177

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.

1 participant