2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

75_MSG,75_msgConfig: fix warnings

git-svn-id: https://svn.fhem.de/fhem/trunk@11617 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2016-06-05 12:56:14 +00:00
parent ad945996fd
commit ff55393550
2 changed files with 14 additions and 7 deletions

View File

@ -37,7 +37,6 @@ use strict;
use warnings;
use Time::HiRes qw(time);
use Data::Dumper;
use msgSchema;
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
no if $] >= 5.017011, warnings => 'experimental::lexical_topic';
@ -52,6 +51,8 @@ sub MSG_Initialize($$) {
"[<type>] [<\@device>|<e-mail address>] [<priority>] [|<title>|] <message-text>",
);
$cmds{msg} = \%hash;
require "$attr{global}{modpath}/FHEM/msgSchema.pm";
}
########################################
@ -167,7 +168,7 @@ s/^[\s\t]*([!]?(([A-Za-z0-9%+._-])*@([%+a-z0-9A-Z.-]+))[\w,@.!|:]*)[\s\t]+//
};
if ( !$@ ) {
eval '$advanced = decode_json( Encode::encode_utf8($1) ); 1';
if (!$@) {
if ( !$@ ) {
Log3 $globalDevName, 5,
"msg: Decoded advanced options\n" . Dumper($advanced);
}

View File

@ -36,7 +36,9 @@ package main;
use strict;
use warnings;
use Data::Dumper;
use msgSchema;
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
no if $] >= 5.017011, warnings => 'experimental::lexical_topic';
sub msgConfig_Set($@);
sub msgConfig_Get($@);
@ -47,6 +49,8 @@ sub msgConfig_Undefine($$);
sub msgConfig_Initialize($) {
my ($hash) = @_;
require "$attr{global}{modpath}/FHEM/msgSchema.pm";
$hash->{DefFn} = "msgConfig_Define";
$hash->{SetFn} = "msgConfig_Set";
$hash->{GetFn} = "msgConfig_Get";
@ -115,7 +119,6 @@ sub msgConfig_Initialize($) {
msgTitleTextHigh
msgTitleTextLow
msgType
);
use warnings 'qw';
$hash->{AttrList} = join( " ", @attrList ) . " " . $readingFnAttributes;
@ -520,7 +523,7 @@ sub msgConfig_Get($@) {
if ( defined( $cmdSchema->{$msgType} ) ) {
my $deviceTypes = $devicesReq;
$deviceTypes = join( ',', keys $cmdSchema->{$msgType} )
$deviceTypes = join( ',', keys %{ $cmdSchema->{$msgType} } )
if ( $deviceTypes eq "" || $devicesReq eq $name );
$deviceTypes = $UserDeviceTypes
if ( $UserDeviceTypes ne "" );
@ -558,8 +561,11 @@ sub msgConfig_Get($@) {
$return .= " Default Values:\n";
foreach my $key (
keys $cmdSchema->{$msgType}{$deviceType}
{defaultValues}{$prio} )
keys %{
$cmdSchema->{$msgType}{$deviceType}
{defaultValues}{$prio}
}
)
{
if ( $cmdSchema->{$msgType}{$deviceType}
{defaultValues}{$prio}{$key} ne "" )