Merge branch 'release/0.4.4'

This commit is contained in:
Erwin Boskma 2022-11-05 10:45:50 +01:00
commit 15dea9bbe9
Signed by: erwin
SSH key fingerprint: SHA256:CyeNoWXd3kjX2Nwu6pDxxdS7OqmPVOy0NavA/KU/ntU
6 changed files with 30 additions and 22 deletions

1
.envrc
View file

@ -1,3 +1,4 @@
watch_file rust-toolchain.toml
use flake use flake
dotenv_if_exists dotenv_if_exists

2
Cargo.lock generated
View file

@ -421,7 +421,7 @@ dependencies = [
[[package]] [[package]]
name = "ha-now-playing" name = "ha-now-playing"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-tungstenite", "async-tungstenite",

View file

@ -1,9 +1,10 @@
[package] [package]
name = "ha-now-playing" name = "ha-now-playing"
description = "Retrieves the state of a media_player entity from Home Assistant" description = "Retrieves the state of a media_player entity from Home Assistant"
version = "0.4.3" version = "0.4.4"
authors = ["Erwin Boskma <erwin@datarift.nl>"] authors = ["Erwin Boskma <erwin@datarift.nl>"]
edition = "2021" edition = "2021"
include = ["src/**/*"]
[dependencies] [dependencies]
anyhow = "1.0.56" anyhow = "1.0.56"

View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1651574473, "lastModified": 1662220400,
"narHash": "sha256-wQhFORvRjo8LB2hTmETmv6cbyKGDPbfWqvZ/0chnDE4=", "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=",
"owner": "nmattia", "owner": "nmattia",
"repo": "naersk", "repo": "naersk",
"rev": "f21309b38e1da0d61b881b6b6d41b81c1aed4e1d", "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -23,11 +23,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1652172129, "lastModified": 1667482890,
"narHash": "sha256-8e2JMrswaKe02P8rYfvIMoc59pNuw6h/GYu8DBE1c+0=", "narHash": "sha256-pua0jp87iwN7NBY5/ypx0s9L9CG49Ju/NI4wGwurHc4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f419dc5763c2b3c5580e396dea065b6d8b58ee27", "rev": "a2a777538d971c6b01c6e54af89ddd6567c055e8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -55,11 +55,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1652236937, "lastModified": 1667616267,
"narHash": "sha256-anMSkIvaxB3jV74nTvPcE8fH7bZ5LPuc2wXGvt50Oe0=", "narHash": "sha256-EYzGCJaTNTSbUk5sa2i4/dn71YtE6uvZb9syL8GH1U0=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "18c816d2d10317f4a8816925a12cb4bbdd0821de", "rev": "a785c5db0ab1b10e6ba04b7240628aea9615e9ad",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -70,11 +70,11 @@
}, },
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1649676176, "lastModified": 1667395993,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -28,7 +28,7 @@
pkgs.openssl pkgs.openssl
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.pkg-config pkgs.pkgconf
]; ];
in in
rec { rec {

View file

@ -18,30 +18,36 @@ mod output;
#[clap(version, author, about)] #[clap(version, author, about)]
struct Opts { struct Opts {
/// Home Assistant host /// Home Assistant host
#[clap(short, long)] #[clap(short, long, env = "HNP_HOST")]
host: String, host: String,
/// Media player entity ID /// Media player entity ID
#[clap(short, long)] #[clap(short, long, env = "HNP_ENTITY")]
entity: String, entity: String,
/// API token /// API token
#[clap(short, long, env)] #[clap(short, long, env = "HNP_TOKEN")]
token: Option<String>, token: Option<String>,
/// File with the API token /// File with the API token
#[clap(long, env)] #[clap(long, env, env = "HNP_TOKEN_FILE")]
token_file: Option<PathBuf>, token_file: Option<PathBuf>,
/// Use HTTP instead of HTTPS /// Use HTTP instead of HTTPS
#[clap(short, long)] #[clap(short, long, env = "HNP_INSECURE")]
insecure: bool, insecure: bool,
/// Output format /// 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, format: output::OutputFormat,
#[clap(short, long)] #[clap(short, long, env = "HNP_DEBUG")]
debug: bool, debug: bool,
#[clap(subcommand)] #[clap(subcommand)]