mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 18:56:03 +00:00
fhem.pl: add status parameter to inform
git-svn-id: https://svn.fhem.de/fhem/trunk@8105 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
aeab708e66
commit
7368a1410d
@ -282,7 +282,7 @@ $readingFnAttributes = "event-on-change-reading event-on-update-reading ".
|
|||||||
Hlp=>"<filename>,read the commands from <filenname>" },
|
Hlp=>"<filename>,read the commands from <filenname>" },
|
||||||
"inform" => { Fn=>"CommandInform",
|
"inform" => { Fn=>"CommandInform",
|
||||||
ClientFilter => "telnet",
|
ClientFilter => "telnet",
|
||||||
Hlp=>"{on|timer|raw|off},echo all events to this client" },
|
Hlp=>"{on|off|raw|timer|status},echo all events to this client" },
|
||||||
"iowrite" => { Fn=>"CommandIOWrite",
|
"iowrite" => { Fn=>"CommandIOWrite",
|
||||||
Hlp=>"<iodev> <data>,write raw data with iodev" },
|
Hlp=>"<iodev> <data>,write raw data with iodev" },
|
||||||
"list" => { Fn=>"CommandList",
|
"list" => { Fn=>"CommandList",
|
||||||
@ -2438,7 +2438,12 @@ CommandInform($$)
|
|||||||
my $name = $cl->{NAME};
|
my $name = $cl->{NAME};
|
||||||
|
|
||||||
return "Usage: inform {on|timer|raw|off} [regexp]"
|
return "Usage: inform {on|timer|raw|off} [regexp]"
|
||||||
if($param !~ m/^(on|off|raw|timer)/);
|
if($param !~ m/^(on|off|raw|timer|status)/);
|
||||||
|
|
||||||
|
if($param eq "status") {
|
||||||
|
my $i = $inform{$name};
|
||||||
|
return $i ? ($i->{type} . ($i->{regexp} ? " ".$i->{regexp} : "")) : "off";
|
||||||
|
}
|
||||||
|
|
||||||
delete($inform{$name});
|
delete($inform{$name});
|
||||||
if($param !~ m/^off/) {
|
if($param !~ m/^off/) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user