2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 07:56:03 +00:00

10_MQTT2_DEVICE.pm: Better devices parsing for graphvis (Forum #91394)

git-svn-id: https://svn.fhem.de/fhem/trunk@18039 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-12-23 15:56:38 +00:00
parent f8856a4b9d
commit 538937ab84

View File

@ -511,12 +511,11 @@ MQTT2_DEVICE_nlData($)
# Needed for the image links
my $dv = ReadingsVal($d, ".devices", ReadingsVal($d, "devices", ""));
for my $l (split(/[\r\n]/, $dv)) {
next if($l !~ m/ieeeAddr":"([^"]+)".*model":"([^"]+)"/);
my $img = $2;
$img =~ s,[/: ],-,g; # Forum #91394, supported-devices.js
$img{$1} = "$pref$img.jpg";
}
$dv =~ s@ieeeAddr":"([^"]+)"[^}]+model":"([^"]+)"@
my $img = $2;
$img =~ s+[/: ]+-+g; # Forum #91394: supported-devices.js
$img{$1} = "$pref$img.jpg";
@xeg;
# Name translation
for my $n (devspec2array("TYPE=MQTT2_DEVICE")) {