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

75_MSG,msgSchema: make title optional for Pushover

git-svn-id: https://svn.fhem.de/fhem/trunk@10395 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2016-01-07 02:10:33 +00:00
parent 74133df9eb
commit 368d682e17
2 changed files with 8 additions and 10 deletions

View File

@ -129,6 +129,7 @@ sub CommandMsg($$;$$) {
s/^[\s\t]*([a-z,]*!?(screen|light|audio|text|push|mail)[a-z,!|]*)[\s\t]+//
)
{
Log3 $globalDevName, 5, "msg: found types=$1";
$types = $1;
}
@ -137,11 +138,13 @@ s/^[\s\t]*([a-z,]*!?(screen|light|audio|text|push|mail)[a-z,!|]*)[\s\t]+//
s/^[\s\t]*([!]?(([A-Za-z0-9%+._-])*@([%+a-z0-9A-Z.-]+))[\w,@.!|:]*)[\s\t]+//
)
{
Log3 $globalDevName, 5, "msg: found recipient=$1";
$recipients = $1;
}
# check for given priority
if ( $msg =~ s/^[\s\t]*([-+]{0,1}\d+[.\d]*)[\s\t]*// ) {
Log3 $globalDevName, 5, "msg: found priority=$1";
$priority = $1;
}
@ -150,6 +153,7 @@ s/^[\s\t]*([!]?(([A-Za-z0-9%+._-])*@([%+a-z0-9A-Z.-]+))[\w,@.!|:]*)[\s\t]+//
s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
)
{
Log3 $globalDevName, 5, "msg: found title=$1";
$title = $1;
}
@ -1743,9 +1747,9 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
)
)
) if ( $title eq "-" );
$loopTitle = undef
if ( $loopTitle eq ""
|| $loopTitle eq "none"
$loopTitle = ""
if ( $loopTitle eq "none"
|| $loopTitle eq "-" );
my $loopMsg = $msg;
@ -1859,7 +1863,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
$cmd =~ s/%DEVICE%/$gatewayDev/gi;
$cmd =~ s/%PRIORITY%/$loopPriority/gi;
$cmd =~ s/%TITLE%/$loopTitle/gi if ($loopTitle);
$cmd =~ s/%TITLE%/$loopTitle/gi;
$cmd =~ s/%MSG%/$loopMsg/gi;
$cmd =~ s/%RECIPIENT%/$subRecipient/gi

View File

@ -180,15 +180,12 @@ my $db = {
'defaultValues' => {
'Normal' => {
'RECIPIENT' => '',
'TITLE' => '',
},
'High' => {
'RECIPIENT' => '',
'TITLE' => '',
},
'Low' => {
'RECIPIENT' => '',
'TITLE' => '',
},
},
},
@ -213,7 +210,6 @@ my $db = {
'EXPIRE' => '',
'URLTITLE' => '',
'ACTION' => '',
'TITLE' => 'System Message',
'Pushover_SOUND' => '',
},
'High' => {
@ -222,7 +218,6 @@ my $db = {
'EXPIRE' => '600',
'URLTITLE' => '',
'ACTION' => '',
'TITLE' => 'System Message',
'Pushover_SOUND' => '',
},
'Low' => {
@ -231,7 +226,6 @@ my $db = {
'EXPIRE' => '',
'URLTITLE' => '',
'ACTION' => '',
'TITLE' => 'System Message',
'Pushover_SOUND' => '',
},
},