diff --git a/75_msgConfig.pm b/75_msgConfig.pm index 49ca255..32a72fd 100755 --- a/75_msgConfig.pm +++ b/75_msgConfig.pm @@ -143,7 +143,7 @@ sub msgConfig_Initialize($) { "msgType:text,push,mail,screen,light,audio,queue", ) { - addToAttrList($_); + addToAttrList( $_, 'msgConfig' ); } return FHEM::Meta::InitMod( __FILE__, $hash ); @@ -171,7 +171,6 @@ sub msgConfig_Define($$) { # create global unique device definition $modules{$TYPE}{defptr} = $hash; - $hash->{SCOPE} = "global"; # set default settings on first define if ( $init_done && !defined( $hash->{OLDDEF} ) ) { @@ -191,9 +190,9 @@ sub msgConfig_Define($$) { readingsEndUpdate( $hash, 1 ); } - $hash->{NOTIFYDEV} = "TYPE=(Jabber|TelegramBot|yowsup)"; + setNotifyDev( $hash, 'TYPE=(Jabber|TelegramBot|yowsup|Signalbot)' ); - return undef; + return; } sub msgConfig_Undefine($$) { @@ -227,9 +226,9 @@ sub msgConfig_Set($@) { # addLocation elsif ( lc($what) eq "addlocation" ) { my $location = join( " ", @a ); - my $group = AttrVal( $name, "group", $TYPE ); - my $room = AttrVal( $name, "room", "" ); - my $return = ""; + my $group = AttrVal( $name, "group", $TYPE ); + my $room = AttrVal( $name, "room", "" ); + my $return = ""; return "Missing argument 'location'" if ( $location eq "" ); @@ -251,7 +250,7 @@ sub msgConfig_Set($@) { } $attr{$device}{group} = $group if ( !defined( $attr{$device}{group} ) ); - $attr{$device}{room} = $room + $attr{$device}{room} = $room if ( !defined( $attr{$device}{room} ) && $room ne "" ); $attr{$device}{comment} = "Auto-created by $name" if ( !defined( $attr{$device}{comment} ) ); @@ -617,6 +616,12 @@ sub msgConfig_Notify($$) { $msg = ReadingsVal( $devName, "message", undef ); } + #Signalbot + elsif ( $devType eq 'Signalbot' ) { + $sender = ReadingsVal( $devName, 'msgSender', undef ); + $msg = ReadingsVal( $devName, 'msgText', undef ); + } + next unless ( $msg && $msg ne "" ); unless ( $sender && $sender ne "" ) { @@ -810,14 +815,19 @@ sub msgConfig_QueueReleaseMsgId($$) { 1; +__END__ + =pod + +=encoding utf8 + =item helper =item summary global settings and tools for FHEM command msg -=item summary_DE globale Einstellungen und Tools f¨r das FHEM Kommando msg +=item summary_DE globale Einstellungen und Tools für das FHEM Kommando msg =begin html

- +

msgConfig @@ -827,30 +837,30 @@ sub msgConfig_QueueReleaseMsgId($$) { A device named globalMsg will be created automatically when using msg-command for the first time and no msgConfig device could be found.
The device name can be renamed and reconfigured afterwards if desired.

- Define +

Define



- Set +

Set

=end html_DE