.local. in python-zeroconf type

103 views Asked by At

I'm trying to use python-zeroconf to find a local service. I know it is there - if I use the mDNS discovery app, the service is found almost instantly. However, while using the python-zeroconf example, the service is not found. The obvious difference (to me) is the presence of ".local." in the service type searched for.

Using the mDNS app, I search for the service type '_hwenergy._tcp' (hwenergy being specific to the device I'm trying to find)

If I use this service type in my python code, I get an exception: BadTypeInNameException: Type '_hwenergy._tcp' must end with '.local.'

If I then add '.local.' to the service type, there is no exception. But also nothing found after minutes of waiting.

Q1: Why do I need to add '.local.' in python-zeroconf? Q2: Why can python-zeroconf not find the service type, whereas the mDNS app can?

BTW I am using python 3.7 on a Chromebook, the 'mDNS discovery' app I got from the Google play store, it's running on the same Chromebook. The python-zeroconf version is 0.112.0, installed using pip.

0

There are 0 answers