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:
parent
99cb29205f
commit
02368bb195
@ -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") {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user