CyBear-Jinni / cbj_hub

🕸️ Easy to use open source Hub to control your smart devices from one app.
https://cybearjinni.com
GNU Affero General Public License v3.0
31 stars 21 forks source link

Get ip from mdns name does not work on some devices #276

Closed guyluz11 closed 1 year ago

guyluz11 commented 1 year ago

As I said here some devices have missing parts like libnss-mdns and configuration /etc/nsswitch.conf.

Not sure if we can just install libnss-mdns in the snap and it will work (as we need to also change /etc/nsswitch.conf content) but I will add it nevertheless.

So we need to find another option that solved it that does not require the user to change config files.

guyluz11 commented 1 year ago

In the next pr I have added lines that use avahi-utils package to find the device IP from mdns name.

The functions in the package avahi-utils can work without changing any conf file.

It will use the functions from there only if the original way fails, we prefer to keep it simple and native to os functions. I count libnss-mdns as os function because it exists in most linux os's by default, and the /etc/nsswitch.conf value that needed is already "correct" in most os's.

guyluz11 commented 1 year ago

Done