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

Supertype query discards subtype in result #1093

Open
Erhannis opened this issue Oct 6, 2022 · 0 comments
Open

Supertype query discards subtype in result #1093

Erhannis opened this issue Oct 6, 2022 · 0 comments

Comments

@Erhannis
Copy link

Erhannis commented Oct 6, 2022

If a device is advertising a service of type "_blah._http._tcp.local.", but I've set ServiceBrowser to filter for its supertype "_http._tcp.local.", then in

    def add_service(self, zc: Zeroconf, type_: str, name: str) -> None:
        info = zc.get_service_info(type_, name)

the type_, and info.type, are both the supertype "_http._tcp.local.", rather than the actual type of the service. IMO, the actual type ought to be accessible. A key point seems to be here:
https://github.com/jstasiak/python-zeroconf/blob/7430ce1c462be0dd210712b4f7b3675efd3a6963/zeroconf/_services/browser.py#L355
wherein the actual type is split into a list of it and its supertypes, I guess? Probably then there's something that filters the resulting events, and only the one keyed to the supertype succeeds.

Desired result: get_service_info ought to include the actual type of the service, and possibly type_ in add_service et al. ought to be the actual type, too, though I'm less convinced of that.

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

No branches or pull requests

1 participant