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

zigbee2mqtt package & module #72320

Merged
merged 3 commits into from Jul 21, 2020
Merged

zigbee2mqtt package & module #72320

merged 3 commits into from Jul 21, 2020

Conversation

sweber83
Copy link
Contributor

@sweber83 sweber83 commented Oct 30, 2019

Motivation for this change

There was neither package nor module for zigbee2mqtt

Things done

Implemented nix package and NixOS module for https://www.zigbee2mqtt.io/

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@sweber83
Copy link
Contributor Author

sweber83 commented Jun 1, 2020

I'm still looking forward to getting this merged.

@Lassulus
Copy link
Member

Lassulus commented Jun 1, 2020

cool,
new services are encouraged to have a test. I see that a full test would be somehow complicated for this. But maybe a simple curl/mqtt test to get the server version from the running daemon would be nice?

thanks for contributing though and sorry for the somewhat huge delay :)

@sweber83
Copy link
Contributor Author

sweber83 commented Jun 1, 2020

@Lassulus
I'll look into writing a simple test
The problem is, i'm pretty sure zigbee2mqtt will not start if the zigbee usb device is not available.
Edit:
It just occurred to me, that maybe, the test should just check that we get the right error message.

@oneingan
Copy link
Contributor

oneingan commented Jul 2, 2020

I'm interested in this, maybe I could help you @sweber83 ?

@sweber83
Copy link
Contributor Author

sweber83 commented Jul 2, 2020

@juaningan
Thanks for reminding me about this pr.
Today I implemented a really simple test, which just tests if zigbee2mqtt fails with the correct error message.

I thought about writing a more thorough test, but did not find the time yet.
Qemu provides a way to set up an emulated serial device which connects to a character device on the host (usb-serial), this could be used to talk to zigbee2mqtt and emulate the missing zigbee usb device.
There is only a small bit of information regarding this capability of Qemu in the docs: https://www.qemu.org/docs/master/system/usb.html
But there is a small example to be found in the mail archive: https://www.redhat.com/archives/libvir-list/2013-January/msg00053.html

The largest hurdle to a thorough test is probably the part of implementing some kind of server, which connects to the character device and talks to zigbee2mqtt over the serial connection.
If you have an idea on to how implement such a thorough test, or just some pointers on improving my minimal test, any help is appreciated!

@CRTified CRTified mentioned this pull request Jul 7, 2020
10 tasks
@mweinelt
Copy link
Member

thought about writing a more thorough test, but did not find the time yet.
Qemu provides a way to set up an emulated serial device which connects to a character device on the host (usb-serial), this could be used to talk to zigbee2mqtt and emulate the missing zigbee usb device.
There is only a small bit of information regarding this capability of Qemu in the docs: https://www.qemu.org/docs/master/system/usb.html
But there is a small example to be found in the mail archive: https://www.redhat.com/archives/libvir-list/2013-January/msg00053.html

Yikes. IMO such a complex test should not be a blocker for this pull request.

@sweber83
Copy link
Contributor Author

@Lassulus
I updated the PR today.
As you can see, I added a minimal test a few weeks back.
Since a more comprehensive test is pretty complicated to implement, I hope to get the PR merged as it is now.

@Lassulus Lassulus merged commit 72f66e7 into NixOS:master Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants