Jan200101 / ShellyPy

Python library to interact with Shelly devices
MIT License
22 stars 14 forks source link

mDNS support #8

Open Jan200101 opened 1 year ago

Jan200101 commented 1 year ago

Shelly devices advertise themselves over mDNS.

providing, at least, some kind of helper for finding shelly devices on the network might be useful.

h3tz commented 1 year ago

just this one: https://docs.pycom.io/firmwareapi/pycom/network/mdns/ ?

Jan200101 commented 1 year ago

That seems to only be relevant to MicroPython, for mDNS discovery https://pypi.python.org/pypi/zeroconf seems to be the widely used implementation.

h3tz commented 1 year ago

That seems to only be relevant to MicroPython, for mDNS discovery https://pypi.python.org/pypi/zeroconf seems to be the widely used implementation.

lets go for it. would you like to implement it or should i do a push with a draft version?

Jan200101 commented 1 year ago

I think it might be useful to do this as part of #11

josolso commented 1 year ago

Honestly I think that ShellyPy is nice as it is. Mixing in zeroconf adds unnecessary complexity.

For initial setup you can use any zeroconf/Avahi browser.

Later on the application knows that e.g. the heater can be controlled by the Shelly "ShellyPro1-123456789012.local" so that you easily can use

device = ShellyPy.Shelly("ShellyPro1-123456789012.local")

ShellyPy does what it is supposed to solve. I'm happy you have made it. Adding zeroconf to it doesn`t look like a good idea to me.

Jan200101 commented 1 year ago

The mDNS/zeroconf/Avahi stuff would be optional, something you can opt into when installing ShellyPy.

Personally I would find it quite useful to be able to find all Shelly devices that advertise themselves on the current network.