2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

74_UnifiVideo.pm: handle changed log format (starting with 3.10.4 ?)

git-svn-id: https://svn.fhem.de/fhem/trunk@19679 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2019-06-21 14:14:29 +00:00
parent 3d33fef49c
commit 0393185b95

View File

@ -385,13 +385,23 @@ UnifiVideo_Read($)
my $line;
($line,$data) = split("\n", $data, 2);
my($cam, $type);
if( $line =~ m/password/ ) {
UnifiVideo_killLogWatcher($hash);
} elsif( $line =~ m/Camera\[([^\]]+)\].*type:([^\s]+)/ ) {
my $cam = $1;
my $type = $2;
$cam = $1;
$type = $2;
} elsif( $line =~ m/AnalyticsService[^[]+\[([^|]+).*type:([^\s]+)/ ) {
$cam = $1;
$type = $2;
} else {
Log3 $name, 2, "$name: got unknown event: $line";
}
if( $cam && $type ) {
if( $type eq 'start' ) {
my $json = $hash->{helper}{json};
$json = [] if( !$json );
@ -411,10 +421,8 @@ UnifiVideo_Read($)
} else {
Log3 $name, 2, "$name: got unknown event type from cam: $cam";
}
} else {
Log3 $name, 2, "$name: got unknown event: $line";
}
}
$hash->{PARTIAL} = $data