70_Pushover.pm: improved userkey and device handling for single messages
git-svn-id: https://svn.fhem.de/fhem/trunk@12371 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -820,13 +820,14 @@ sub Pushover_SetMessage {
|
|||||||
|
|
||||||
# check if we got a user or group key as device and use it as
|
# check if we got a user or group key as device and use it as
|
||||||
# user-key instead of hash->USER_KEY
|
# user-key instead of hash->USER_KEY
|
||||||
if ( $values{device} =~ /^([A-Za-z0-9]{30})(:([A-Za-z0-9_-]+))?$/s ) {
|
if ( $values{device} =~ /^([A-Za-z0-9]{30})?:?([A-Za-z0-9_-]*)?$/s ) {
|
||||||
$values{USER_KEY} = $1;
|
$values{USER_KEY} = $1 if ( $1 ne "" );
|
||||||
$values{device} = $3;
|
$values{device} = $2;
|
||||||
|
|
||||||
return $hash->{helper}{FAILED_USERKEYS}{ $values{USER_KEY} }
|
return $hash->{helper}{FAILED_USERKEYS}{ $values{USER_KEY} }
|
||||||
if (
|
if ( $values{USER_KEY}
|
||||||
defined( $hash->{helper}{FAILED_USERKEYS}{ $values{USER_KEY} } ) );
|
&& defined( $hash->{helper}{FAILED_USERKEYS}{ $values{USER_KEY} } )
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if all mandatory arguments are filled:
|
# Check if all mandatory arguments are filled:
|
||||||
|
|||||||
Reference in New Issue
Block a user