mirror of
https://github.com/brmlab/brmdoor.git
synced 2025-06-09 04:04:02 +02:00
brmd::IRC notify_door_open: Report only alert conditions
This commit is contained in:
parent
651aeffaf9
commit
d617d799dd
1 changed files with 3 additions and 2 deletions
|
@ -699,9 +699,10 @@ sub notify_door_unlocked {
|
||||||
|
|
||||||
sub notify_door_open {
|
sub notify_door_open {
|
||||||
my ($sender, $newstate, $alert) = @_[SENDER, ARG0, ARG1];
|
my ($sender, $newstate, $alert) = @_[SENDER, ARG0, ARG1];
|
||||||
|
$alert or return;
|
||||||
|
|
||||||
my $irc = $_[HEAP]->{irc};
|
my $irc = $_[HEAP]->{irc};
|
||||||
my $msg = "[door] $newstate";
|
my $msg = "[door] $newstate \002(alert: closed brmlab, door opened, not unlocked)";
|
||||||
$alert and $msg .= " \002(alert: closed brmlab, door opened, not unlocked)";
|
|
||||||
$irc->yield (privmsg => $channel => $msg );
|
$irc->yield (privmsg => $channel => $msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue