From b9eb4500ff3f5eba6c6d063fd4506377406d33e8 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Mon, 4 Jul 2022 11:16:46 +0200 Subject: [PATCH 1/5] Update flake.lock --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index bfda706..d0e1fdf 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1651574473, - "narHash": "sha256-wQhFORvRjo8LB2hTmETmv6cbyKGDPbfWqvZ/0chnDE4=", + "lastModified": 1655042882, + "narHash": "sha256-9BX8Fuez5YJlN7cdPO63InoyBy7dm3VlJkkmTt6fS1A=", "owner": "nmattia", "repo": "naersk", - "rev": "f21309b38e1da0d61b881b6b6d41b81c1aed4e1d", + "rev": "cddffb5aa211f50c4b8750adbec0bbbdfb26bb9f", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1652172129, - "narHash": "sha256-8e2JMrswaKe02P8rYfvIMoc59pNuw6h/GYu8DBE1c+0=", + "lastModified": 1656753965, + "narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f419dc5763c2b3c5580e396dea065b6d8b58ee27", + "rev": "0ea7a8f1b939d74e5df8af9a8f7342097cdf69eb", "type": "github" }, "original": { @@ -55,11 +55,11 @@ ] }, "locked": { - "lastModified": 1652236937, - "narHash": "sha256-anMSkIvaxB3jV74nTvPcE8fH7bZ5LPuc2wXGvt50Oe0=", + "lastModified": 1656903194, + "narHash": "sha256-M8JyQzyQfv3nilWGKGBLrsnRl8E4JtjHv40AWW1rZ+0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "18c816d2d10317f4a8816925a12cb4bbdd0821de", + "rev": "ab4d2623fe20ac2a8e6128567148664ad91ed9d0", "type": "github" }, "original": { @@ -70,11 +70,11 @@ }, "utils": { "locked": { - "lastModified": 1649676176, - "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "lastModified": 1656065134, + "narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c", "type": "github" }, "original": { From ad37248ec64cf32837493fea3f49949db5fd9325 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Mon, 4 Jul 2022 11:17:01 +0200 Subject: [PATCH 2/5] Apply cargo-diet --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 3e5c36a..e71b286 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ description = "Retrieves the state of a media_player entity from Home Assistant" version = "0.4.3" authors = ["Erwin Boskma "] edition = "2021" +include = ["src/**/*"] [dependencies] anyhow = "1.0.56" From 22b6ecdd4a87720ee53fa66074106672935da21c Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Sat, 5 Nov 2022 10:43:20 +0100 Subject: [PATCH 3/5] Update flake.lock --- .envrc | 1 + flake.lock | 24 ++++++++++++------------ flake.nix | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.envrc b/.envrc index b915ba0..5edf0c2 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,4 @@ +watch_file rust-toolchain.toml use flake dotenv_if_exists diff --git a/flake.lock b/flake.lock index d0e1fdf..f98a0a8 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1655042882, - "narHash": "sha256-9BX8Fuez5YJlN7cdPO63InoyBy7dm3VlJkkmTt6fS1A=", + "lastModified": 1662220400, + "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", "owner": "nmattia", "repo": "naersk", - "rev": "cddffb5aa211f50c4b8750adbec0bbbdfb26bb9f", + "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1656753965, - "narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=", + "lastModified": 1667482890, + "narHash": "sha256-pua0jp87iwN7NBY5/ypx0s9L9CG49Ju/NI4wGwurHc4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0ea7a8f1b939d74e5df8af9a8f7342097cdf69eb", + "rev": "a2a777538d971c6b01c6e54af89ddd6567c055e8", "type": "github" }, "original": { @@ -55,11 +55,11 @@ ] }, "locked": { - "lastModified": 1656903194, - "narHash": "sha256-M8JyQzyQfv3nilWGKGBLrsnRl8E4JtjHv40AWW1rZ+0=", + "lastModified": 1667616267, + "narHash": "sha256-EYzGCJaTNTSbUk5sa2i4/dn71YtE6uvZb9syL8GH1U0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "ab4d2623fe20ac2a8e6128567148664ad91ed9d0", + "rev": "a785c5db0ab1b10e6ba04b7240628aea9615e9ad", "type": "github" }, "original": { @@ -70,11 +70,11 @@ }, "utils": { "locked": { - "lastModified": 1656065134, - "narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7478b2b..0635c23 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ pkgs.openssl ]; nativeBuildInputs = [ - pkgs.pkg-config + pkgs.pkgconf ]; in rec { From 151ebbe8a650ea673146e08ab7dfd95075062184 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Sat, 5 Nov 2022 10:43:29 +0100 Subject: [PATCH 4/5] Allow options to be set from environment variables --- src/main.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7f4fc8b..f72a524 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,30 +18,36 @@ mod output; #[clap(version, author, about)] struct Opts { /// Home Assistant host - #[clap(short, long)] + #[clap(short, long, env = "HNP_HOST")] host: String, /// Media player entity ID - #[clap(short, long)] + #[clap(short, long, env = "HNP_ENTITY")] entity: String, /// API token - #[clap(short, long, env)] + #[clap(short, long, env = "HNP_TOKEN")] token: Option, /// File with the API token - #[clap(long, env)] + #[clap(long, env, env = "HNP_TOKEN_FILE")] token_file: Option, /// Use HTTP instead of HTTPS - #[clap(short, long)] + #[clap(short, long, env = "HNP_INSECURE")] insecure: bool, /// Output format - #[clap(arg_enum, short, long, default_value = "waybar")] + #[clap( + arg_enum, + short, + long, + env = "HNP_OUTPUT_FORMAT", + default_value = "waybar" + )] format: output::OutputFormat, - #[clap(short, long)] + #[clap(short, long, env = "HNP_DEBUG")] debug: bool, #[clap(subcommand)] From 401cd73c1fff428e2297d9d9731d772b13a82633 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Sat, 5 Nov 2022 10:44:25 +0100 Subject: [PATCH 5/5] Bump version to 0.4.4 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d2fe83..20ed766 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -421,7 +421,7 @@ dependencies = [ [[package]] name = "ha-now-playing" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "async-tungstenite", diff --git a/Cargo.toml b/Cargo.toml index e71b286..eab2466 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ha-now-playing" description = "Retrieves the state of a media_player entity from Home Assistant" -version = "0.4.3" +version = "0.4.4" authors = ["Erwin Boskma "] edition = "2021" include = ["src/**/*"]