From a7df4761243ae4f9a1ebc74ebbfa29700ee92617 Mon Sep 17 00:00:00 2001 From: PatrickR <> Date: Wed, 24 Jul 2024 19:44:31 +0000 Subject: [PATCH] ble2mqttd: Version 0.16, fixed watchdog, changed exit code git-svn-id: https://svn.fhem.de/fhem/trunk@29040 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/ble2mqttd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fhem/contrib/ble2mqttd b/fhem/contrib/ble2mqttd index 57904a5d0..3c28b0e1c 100644 --- a/fhem/contrib/ble2mqttd +++ b/fhem/contrib/ble2mqttd @@ -78,7 +78,7 @@ Readonly my $DEFAULT_RSSI_THRESHOLD => 10; Readonly my $DEFAULT_ABSENT_INTERVAL => 60; Readonly my $ME => 'ble2mqttd'; -Readonly my $VERSION => '0.15'; +Readonly my $VERSION => '0.16'; Readonly my $PIDFILE => "/var/run/$ME.pid"; my ($mqtt, $bluetoothctl, $loglevel, $logtarget, $debug); @@ -151,7 +151,7 @@ sub usage_exit { printf("\t%s --mqttserver mqtt.domain:8883 --mqttfingerprint 'sha256\$11e20bbb668da517a0ae8536f3c79887d06ddec945fab60401deab92dc7e7c1f' --mqttuser user --mqttpass pass\n", $ME); printf("\t%s --mqttserver mqtt.domain:8883 --mqttfingerprint 'sha256\$11e20bbb668da517a0ae8536f3c79887d06ddec945fab60401deab92dc7e7c1f' --mqttuser user --mqttpass pass --mac 'AB:CD:EF:.*'\n", $ME); closelog(); - exit(1); + exit(2); } sub parse_loglevel { @@ -420,12 +420,13 @@ sub handle_match { $info =~ s/\s+$//; $mac = uc($mac); + $lastevent = time(); + if($macregex && $mac!~/$macregex/i) { printf("%s### Match (filtered): [%s] %s (%s)\n", tsprefix(), $type, $mac, $info) if ($debug >= 2); return(); } - $lastevent = time(); if (my ($rssi) = ($info =~ m/^RSSI: (-?[0-9]+)$/)) { printf("%s### Match RSSI: [%s] %s -> %s\n", tsprefix(), $type, $mac, $rssi) if ($debug >= 2); $devices{$mac}{'rssi'}=$rssi;