This commit is contained in:
Moritz Ruth 2023-03-18 21:36:35 +01:00
parent a67afb7e90
commit 03fc1b1ec8
Signed by: moritzruth
GPG key ID: C9BBAB79405EE56D
6 changed files with 6 additions and 14 deletions

2
Cargo.lock generated
View file

@ -667,7 +667,7 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]] [[package]]
name = "hassliebe" name = "hassliebe"
version = "0.1.0" version = "1.0.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64", "base64",

View file

@ -1,10 +1,11 @@
[package] [package]
name = "hassliebe" name = "hassliebe"
version = "0.1.0" version = "1.0.0"
edition = "2021" edition = "2021"
license = "BlueOak-1.0.0"
authors = ["Moritz Ruth <dev@moritzruth.de>"]
homepage = "https://git.moritzruth.de/moritzruth/Hassliebe" homepage = "https://git.moritzruth.de/moritzruth/Hassliebe"
repository = "https://git.moritzruth.de/moritzruth/Hassliebe"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features] [features]
dry_run = [] # will prevent some actions like shutting down dry_run = [] # will prevent some actions like shutting down

View file

@ -11,7 +11,6 @@
- [ ] Media control (MPRIS) - [ ] Media control (MPRIS)
- [ ] PipeWire control - [ ] PipeWire control
- [ ] File watcher - [ ] File watcher
- [ ] Fallback MQTT broker address
Ideas: Ideas:

View file

@ -1,4 +1,3 @@
use std::fs::ReadDir;
use std::time::Duration; use std::time::Duration;
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};

View file

@ -24,7 +24,7 @@ pub async fn create_client(config: &config::Config, machine_id: &str, availabili
options.set_inflight(30); options.set_inflight(30);
options.set_max_packet_size( options.set_max_packet_size(
30 * 1000 * 1000, // 30 MB 30 * 1024 * 1024, // 30 MiB
usize::MAX, usize::MAX,
); );

View file

@ -18,13 +18,6 @@ pub fn spawn_nonessential(future: impl Future<Output=Result<()>> + Send + 'stati
}) })
} }
#[inline]
pub fn run_nonessential(block: impl FnOnce() -> Result<()>) {
if let Err(error) = block() {
log_error(error);
}
}
#[inline] #[inline]
pub fn log_error(error: anyhow::Error) { pub fn log_error(error: anyhow::Error) {
log::error!("{:#}", error); log::error!("{:#}", error);