don't say ok after errors

This commit is contained in:
Alex Janka 2024-04-02 08:53:27 +11:00
parent ed811bcfdc
commit 62a934fc20
5 changed files with 11 additions and 17 deletions

4
Cargo.lock generated
View file

@ -1120,7 +1120,7 @@ dependencies = [
[[package]] [[package]]
name = "homekit-controller" name = "homekit-controller"
version = "0.5.3" version = "0.5.5"
dependencies = [ dependencies = [
"chacha20poly1305", "chacha20poly1305",
"ed25519-dalek", "ed25519-dalek",
@ -1143,7 +1143,7 @@ dependencies = [
[[package]] [[package]]
name = "homekit-exporter" name = "homekit-exporter"
version = "0.5.4" version = "0.5.5"
dependencies = [ dependencies = [
"clap", "clap",
"env_logger", "env_logger",

View file

@ -1,9 +1,11 @@
[package] [package]
name = "homekit-controller" name = "homekit-controller"
version = "0.5.3" version = "0.5.5"
edition = "2021" edition = "2021"
license = "Apache-2.0"
description = "Partial implementation of the HomeKit controller protocol"
authors = ["Alex Janka"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View file

@ -334,23 +334,15 @@ impl DeviceConnection {
} }
Some(socket) => { Some(socket) => {
for (aid, data) in &mut self.accessories { for (aid, data) in &mut self.accessories {
's: for service in data.services.values_mut() { for service in data.services.values_mut() {
let characteristic_ids = service let characteristic_ids = service
.characteristics .characteristics
.keys() .keys()
.map(|k| format!("{aid}.{k}")) .map(|k| format!("{aid}.{k}"))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let characteristics = match socket let characteristics = socket
.get_characteristics(&characteristic_ids, additional_data) .get_characteristics(&characteristic_ids, additional_data)
.await .await?;
{
Ok(v) => v,
Err(e) => {
log::warn!("{}error getting characteristics{} {characteristic_ids:?}:\n\t{e:?}", formatted_name(&self.name), service.name.as_ref().map(|n|format!(" for {n}")).unwrap_or_default());
continue 's;
}
};
for (cid, c) in &characteristics { for (cid, c) in &characteristics {
if c.characteristic_type == CharacteristicType::Name { if c.characteristic_type == CharacteristicType::Name {
if let Some(Data::String(name)) = &c.value { if let Some(Data::String(name)) = &c.value {

View file

@ -1,6 +1,6 @@
[package] [package]
name = "homekit-exporter" name = "homekit-exporter"
version = "0.5.4" version = "0.5.5"
edition = "2021" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
description = "Prometheus exporter for HomeKit sensors" description = "Prometheus exporter for HomeKit sensors"

View file

@ -1,7 +1,7 @@
# Maintainer: Alex Janka <alex@alexjanka.com> # Maintainer: Alex Janka <alex@alexjanka.com>
pkgname=homekit-logger pkgname=homekit-logger
pkgver=0.5.4 pkgver=0.5.5
pkgrel=1 pkgrel=1
pkgdesc="Prometheus exporter for HomeKit sensors" pkgdesc="Prometheus exporter for HomeKit sensors"
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')