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

00_MQTT2_SERVER.pm: add lastPublish reading to avoid set-events (Forum #108630)

git-svn-id: https://svn.fhem.de/fhem/trunk@21256 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-02-23 12:28:09 +00:00
parent 99cb29205f
commit 02368bb195
2 changed files with 3 additions and 1 deletions

View File

@ -248,6 +248,7 @@ MQTT2_CLIENT_Set($@)
return "Usage: set $name publish -r topic [value]" if(@a < 1);
my $tp = shift(@a);
my $val = join(" ", @a);
readingsSingleUpdate($hash, "lastPublish", "$tp:$val", 0);
MQTT2_CLIENT_doPublish($hash, $tp, $val, $retain);
} elsif($a[0] eq "password") {

View File

@ -51,7 +51,7 @@ MQTT2_SERVER_Initialize($)
sslCertPrefix
);
use warnings 'qw';
$hash->{AttrList} = join(" ", @attrList);
$hash->{AttrList} = join(" ", @attrList)." ".$readingFnAttributes;
}
#####################################
@ -162,6 +162,7 @@ MQTT2_SERVER_Set($@)
return "Usage: publish -r topic [value]" if(@a < 1);
my $tp = shift(@a);
my $val = join(" ", @a);
readingsSingleUpdate($hash, "lastPublish", "$tp:$val", 0);
MQTT2_SERVER_doPublish($hash->{CL}, $hash, $tp, $val, $retain);
}
}