-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
zigbee2mqtt_2: init at 2.1.1 #371053
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
Merged
Merged
zigbee2mqtt_2: init at 2.1.1 #371053
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,44 @@ | ||
| import ./make-test-python.nix ( | ||
| { pkgs, lib, ... }: | ||
| { | ||
| name = "zigbee2mqtt"; | ||
| nodes.machine = | ||
| { pkgs, ... }: | ||
| { | ||
| systemd.services.dummy-serial = { | ||
| wantedBy = [ | ||
| "multi-user.target" | ||
| ]; | ||
| serviceConfig = { | ||
| ExecStart = "${pkgs.socat}/bin/socat pty,link=/dev/ttyACM0,mode=666 pty,link=/dev/ttyACM1"; | ||
| }; | ||
| }; | ||
| { | ||
| lib, | ||
| package, | ||
| pkgs, | ||
| ... | ||
| }: | ||
|
|
||
| services.zigbee2mqtt = { | ||
| enable = true; | ||
| }; | ||
|
|
||
| systemd.services.zigbee2mqtt.serviceConfig.DevicePolicy = lib.mkForce "auto"; | ||
| let | ||
| error = | ||
| if lib.versionOlder package.version "2" then | ||
| "Inappropriate ioctl for device, cannot set" | ||
| else | ||
| "No valid USB adapter found"; | ||
| in | ||
| { | ||
| name = "zigbee2mqtt-${lib.versions.major package.version}.x"; | ||
| nodes.machine = { | ||
| systemd.services.dummy-serial = { | ||
| wantedBy = [ | ||
| "multi-user.target" | ||
| ]; | ||
| serviceConfig = { | ||
| ExecStart = "${pkgs.socat}/bin/socat pty,link=/dev/ttyACM0,mode=666 pty,link=/dev/ttyACM1"; | ||
| }; | ||
| }; | ||
|
|
||
| services.zigbee2mqtt = { | ||
| enable = true; | ||
| inherit package; | ||
| }; | ||
|
|
||
| systemd.services.zigbee2mqtt.serviceConfig.DevicePolicy = lib.mkForce "auto"; | ||
| }; | ||
|
|
||
| testScript = '' | ||
| machine.wait_for_unit("multi-user.target") | ||
| machine.wait_until_fails("systemctl status zigbee2mqtt.service") | ||
| machine.succeed( | ||
| "journalctl -eu zigbee2mqtt | grep 'Error: Inappropriate ioctl for device, cannot set'" | ||
| ) | ||
| testScript = '' | ||
| machine.wait_for_unit("multi-user.target") | ||
| machine.wait_until_fails("systemctl status zigbee2mqtt.service") | ||
| machine.succeed( | ||
| "journalctl -eu zigbee2mqtt | grep '${error}'" | ||
| ) | ||
|
|
||
| machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service")) | ||
| ''; | ||
| } | ||
| ) | ||
| machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service")) | ||
| ''; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| buildNpmPackage, | ||
| fetchFromGitHub, | ||
| systemdMinimal, | ||
| nixosTests, | ||
| nix-update-script, | ||
| withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal, | ||
| }: | ||
|
|
||
| buildNpmPackage rec { | ||
| pname = "zigbee2mqtt"; | ||
| version = "1.42.0"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "Koenkk"; | ||
| repo = "zigbee2mqtt"; | ||
| rev = version; | ||
| hash = "sha256-/7mZrf3FyIliCzsy6yzVRJYMy4bViphYi81UY43iO98="; | ||
| }; | ||
|
|
||
| npmDepsHash = "sha256-heqTYLC+TQPQ2dc5MrVdvJeNqrygC4tUgkLcfKvlYvE="; | ||
|
|
||
| buildInputs = lib.optionals withSystemd [ | ||
| systemdMinimal | ||
| ]; | ||
|
|
||
| npmFlags = lib.optionals (!withSystemd) [ "--omit=optional" ]; | ||
|
|
||
| passthru.tests.zigbee2mqtt = nixosTests.zigbee2mqtt; | ||
| passthru.updateScript = nix-update-script { }; | ||
|
|
||
| meta = with lib; { | ||
| changelog = "https://github.com/Koenkk/zigbee2mqtt/releases/tag/${version}"; | ||
| description = "Zigbee to MQTT bridge using zigbee-shepherd"; | ||
| homepage = "https://github.com/Koenkk/zigbee2mqtt"; | ||
| license = licenses.gpl3; | ||
| longDescription = '' | ||
| Allows you to use your Zigbee devices without the vendor's bridge or gateway. | ||
|
|
||
| It bridges events and allows you to control your Zigbee devices via MQTT. | ||
| In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using. | ||
| ''; | ||
| maintainers = with maintainers; [ | ||
| sweber | ||
| hexa | ||
| ]; | ||
| mainProgram = "zigbee2mqtt"; | ||
| }; | ||
| } | ||
| { zigbee2mqtt_1 }: zigbee2mqtt_1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| buildNpmPackage, | ||
| fetchFromGitHub, | ||
| systemdMinimal, | ||
| nixosTests, | ||
| nix-update-script, | ||
| withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal, | ||
| }: | ||
|
|
||
| buildNpmPackage rec { | ||
| pname = "zigbee2mqtt"; | ||
| version = "1.42.0"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "Koenkk"; | ||
| repo = "zigbee2mqtt"; | ||
| rev = version; | ||
| hash = "sha256-/7mZrf3FyIliCzsy6yzVRJYMy4bViphYi81UY43iO98="; | ||
| }; | ||
|
|
||
| npmDepsHash = "sha256-heqTYLC+TQPQ2dc5MrVdvJeNqrygC4tUgkLcfKvlYvE="; | ||
|
|
||
| buildInputs = lib.optionals withSystemd [ | ||
| systemdMinimal | ||
| ]; | ||
|
|
||
| npmFlags = lib.optionals (!withSystemd) [ "--omit=optional" ]; | ||
|
|
||
| passthru.tests.zigbee2mqtt = nixosTests.zigbee2mqtt_1; | ||
| passthru.updateScript = nix-update-script { }; | ||
|
|
||
| meta = with lib; { | ||
| changelog = "https://github.com/Koenkk/zigbee2mqtt/releases/tag/${version}"; | ||
| description = "Zigbee to MQTT bridge using zigbee-shepherd"; | ||
| homepage = "https://github.com/Koenkk/zigbee2mqtt"; | ||
| license = licenses.gpl3; | ||
| longDescription = '' | ||
| Allows you to use your Zigbee devices without the vendor's bridge or gateway. | ||
|
|
||
| It bridges events and allows you to control your Zigbee devices via MQTT. | ||
| In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using. | ||
| ''; | ||
| maintainers = with maintainers; [ | ||
| sweber | ||
| hexa | ||
| ]; | ||
| mainProgram = "zigbee2mqtt"; | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| fetchFromGitHub, | ||
| nodejs, | ||
| npmHooks, | ||
| pnpm_9, | ||
| systemdMinimal, | ||
| nixosTests, | ||
| nix-update-script, | ||
| withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal, | ||
| }: | ||
|
|
||
| let | ||
| pnpm = pnpm_9; | ||
| in | ||
| stdenv.mkDerivation (finalAttrs: { | ||
| pname = "zigbee2mqtt"; | ||
| version = "2.1.1"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "Koenkk"; | ||
| repo = "zigbee2mqtt"; | ||
| tag = finalAttrs.version; | ||
| hash = "sha256-YVsQ4Zo0nlIb9m4wiK7xcqB7eE/h2ZvTTqEYLDagoHM="; | ||
| }; | ||
|
|
||
| pnpmDeps = pnpm.fetchDeps { | ||
| inherit (finalAttrs) pname version src; | ||
| hash = "sha256-Wr7FngKfedUrtOLpaTxvAdJZfCXo1/+oLMIJMOCgafk="; | ||
| }; | ||
|
|
||
| nativeBuildInputs = [ | ||
| nodejs | ||
| npmHooks.npmInstallHook | ||
| pnpm.configHook | ||
| ]; | ||
|
|
||
| buildInputs = lib.optionals withSystemd [ | ||
| systemdMinimal | ||
| ]; | ||
|
|
||
| buildPhase = '' | ||
| runHook preBuild | ||
|
|
||
| pnpm run build | ||
|
|
||
| runHook postBuild | ||
| ''; | ||
|
|
||
| dontNpmPrune = true; | ||
|
|
||
| passthru.tests.zigbee2mqtt = nixosTests.zigbee2mqtt_2; | ||
| passthru.updateScript = nix-update-script { }; | ||
|
|
||
| meta = with lib; { | ||
| changelog = "https://github.com/Koenkk/zigbee2mqtt/releases/tag/${finalAttrs.version}"; | ||
| description = "Zigbee to MQTT bridge using zigbee-shepherd"; | ||
| homepage = "https://github.com/Koenkk/zigbee2mqtt"; | ||
| license = licenses.gpl3; | ||
| longDescription = '' | ||
| Allows you to use your Zigbee devices without the vendor's bridge or gateway. | ||
|
|
||
| It bridges events and allows you to control your Zigbee devices via MQTT. | ||
| In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using. | ||
| ''; | ||
| maintainers = with maintainers; [ | ||
| sweber | ||
| hexa | ||
| ]; | ||
| mainProgram = "zigbee2mqtt"; | ||
| }; | ||
| }) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.