Compare commits

..

No commits in common. "ff78898683a7926cddbd7e3784976d6e4546094f" and "8c4c3cb78ebc02b533be29b33ed95a63bfd3630c" have entirely different histories.

7 changed files with 12 additions and 32 deletions

4
Cargo.lock generated
View file

@ -1155,7 +1155,7 @@ dependencies = [
[[package]] [[package]]
name = "homekit-controller" name = "homekit-controller"
version = "0.6.2" version = "0.5.5"
dependencies = [ dependencies = [
"chacha20poly1305", "chacha20poly1305",
"ed25519-dalek", "ed25519-dalek",
@ -1178,7 +1178,7 @@ dependencies = [
[[package]] [[package]]
name = "homekit-exporter" name = "homekit-exporter"
version = "0.6.2" version = "0.6.1"
dependencies = [ dependencies = [
"chrono", "chrono",
"clap", "clap",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "homekit-controller" name = "homekit-controller"
version = "0.6.2" version = "0.5.5"
edition = "2021" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
description = "Partial implementation of the HomeKit controller protocol" description = "Partial implementation of the HomeKit controller protocol"

View file

@ -311,17 +311,15 @@ impl DeviceConnection {
self.characteristics_request(true), self.characteristics_request(true),
) )
.await .await
.map_err(|_| HomekitError::Timeout)
.flatten_result()
{ {
Ok(r) => Ok(r), Ok(r) => r,
Err(e) => { Err(_) => {
log::warn!( log::warn!(
"{}failed to update characteristics: {e:?}", "{}failed to update characteristics",
formatted_name(&self.name) formatted_name(&self.name)
); );
self.socket = None; self.socket = None;
Err(e) Err(HomekitError::Timeout)
} }
} }
} }
@ -434,24 +432,6 @@ pub enum HomekitError {
NoData, NoData,
} }
trait FlattenResult {
type T;
type E;
fn flatten_result(self) -> Result<Self::T, Self::E>;
}
impl<T, E> FlattenResult for Result<Result<T, E>, E> {
type T = T;
type E = E;
fn flatten_result(self) -> Result<Self::T, Self::E> {
match self {
Ok(v) => v,
Err(e) => Err(e),
}
}
}
#[derive(Debug, Error)] #[derive(Debug, Error)]
pub enum ConnectionError { pub enum ConnectionError {
#[error("http")] #[error("http")]

View file

@ -686,7 +686,7 @@ impl From<CharacteristicTypeInner> for CharacteristicType {
fn from(value: CharacteristicTypeInner) -> Self { fn from(value: CharacteristicTypeInner) -> Self {
match value { match value {
CharacteristicTypeInner::Unknown(v) => { CharacteristicTypeInner::Unknown(v) => {
log::debug!("unknown characteristic type: {v}"); log::info!("unknown characteristic type: {v}");
Self::Unknown Self::Unknown
} }
CharacteristicTypeInner::AccessControlLevel => Self::AccessControlLevel, CharacteristicTypeInner::AccessControlLevel => Self::AccessControlLevel,
@ -1206,7 +1206,7 @@ impl From<ServiceTypeInner> for ServiceType {
fn from(value: ServiceTypeInner) -> Self { fn from(value: ServiceTypeInner) -> Self {
match value { match value {
ServiceTypeInner::Unknown(v) => { ServiceTypeInner::Unknown(v) => {
log::debug!("unknown service type: {v}"); log::info!("unknown service type: {v}");
Self::Unknown Self::Unknown
} }
ServiceTypeInner::AccessControl => Self::AccessControl, ServiceTypeInner::AccessControl => Self::AccessControl,

View file

@ -1,6 +1,6 @@
[package] [package]
name = "homekit-exporter" name = "homekit-exporter"
version = "0.6.2" version = "0.6.1"
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.6.2 pkgver=0.6.1
pkgrel=1 pkgrel=1
pkgdesc="Prometheus exporter for HomeKit sensors" pkgdesc="Prometheus exporter for HomeKit sensors"
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')

View file

@ -7,7 +7,7 @@ StartLimitIntervalSec=0
Type=simple Type=simple
Restart=always Restart=always
RestartSec=10s RestartSec=10s
Environment="RUST_LOG=warn,mdns=off" Environment="RUST_LOG=error,warn,mdns=off,homekit_controller::pairing_data::characteristics=off"
Environment="LOG_TIMESTAMP=false" Environment="LOG_TIMESTAMP=false"
ExecStart=/usr/bin/homekit-exporter watch ExecStart=/usr/bin/homekit-exporter watch