Koenkk / zigbee-herdsman

A Node.js Zigbee library
MIT License
456 stars 277 forks source link

add mdns discovery for network coordinators #704

Closed Tarik2142 closed 1 year ago

Tarik2142 commented 1 year ago

I described everything in the request here #https://github.com/Koenkk/zigbee2mqtt/issues/17430 I don't know much about typescript so improvements are welcome image image

Koenkk commented 1 year ago

Thanks for the PR, in order to get this merged:

Tarik2142 commented 1 year ago

Thanks for the PR, in order to get this merged:

image Ok, thanks for the reply. I think there will be no problems with the documentation, but I've never written tests, so I'll have to figure it out. I ran a local check and somehow it passes. Here on github everything correctly shows that there are no tests for lines 85-115 I would be grateful for a hint why the local check is passing

Koenkk commented 1 year ago

Can you try to do a npm ci and then a npm run-test-with-coverage?

Tarik2142 commented 1 year ago

Can you try to do a npm ci and then a npm run-test-with-coverage?

Can you try to do a npm ci and then a npm run-test-with-coverage?

Unfortunately that didn't help so I'll look here sometimes. Also, I got a strange thing in the test system, when passing the LoggerStub to the Adapter, the logger for some reason still remains undefined and causes an error

Tarik2142 commented 1 year ago

why line 107 is uncovered? do i need to check all radio types?

Tarik2142 commented 1 year ago

After the PR to the documentation, I will update the code and add a links to the documentation in the error messages

Tarik2142 commented 1 year ago

So the links exceed the length limit, how should I shorten them?

Tarik2142 commented 1 year ago

@Koenkk PR to docs is ready https://github.com/Koenkk/zigbee2mqtt.io/pull/2028

Koenkk commented 1 year ago

@Tarik2142 I made some updates, can you check if everything is still ok? If yes, I will merge this.

Tarik2142 commented 1 year ago

@Koenkk Tested the changes on my installation. image Everything works.

Also tested handling of some errors, except the wrong packet, this requires changing the firmware of the coordinator image image

Koenkk commented 1 year ago

Great, thanks for this cool feature!

stefa168 commented 11 months ago

@Tarik2142 sorry for the ping; what functionalities this PR would bring to a user? I am just curious about it 👀

Tarik2142 commented 11 months ago

@Tarik2142 sorry for the ping; what functionalities this PR would bring to a user? I am just curious about it 👀

https://www.zigbee2mqtt.io/guide/configuration/adapter-settings.html#mdns-zeroconf-discovery If your coordinator supports this functionality, you can type mdns name in the configuration, IP, port and adapter type will be determined automatically. Even if the IP of the adapter changes, it will still be found. This simplifies the configuration