diff --git a/fhem/FHEM/21_OWAD.pm b/fhem/FHEM/21_OWAD.pm index bd9838475..773dfe210 100644 --- a/fhem/FHEM/21_OWAD.pm +++ b/fhem/FHEM/21_OWAD.pm @@ -76,7 +76,7 @@ use strict; use warnings; sub Log($$); -my $owx_version="5.05"; +my $owx_version="5.06"; #-- fixed raw channel name, flexible channel name my @owg_fixed = ("A","B","C","D"); my @owg_channel = ("A","B","C","D"); @@ -286,31 +286,35 @@ sub OWAD_Attr(@) { my $ret; if ( $do eq "set") { - #-- interval modified at runtime - $key eq "interval" and do { - #-- check value - return "OWAD: Set with short interval, must be > 1" if(int($value) < 1); - #-- update timer - $hash->{INTERVAL} = $value; - if ($init_done) { - RemoveInternalTimer($hash); - InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWAD_GetValues", $hash, 1); + ARGUMENT_HANDLER: { + #-- interval modified at runtime + $key eq "interval" and do { + #-- check value + return "OWAD: Set with short interval, must be > 1" if(int($value) < 1); + #-- update timer + $hash->{INTERVAL} = $value; + if ($init_done) { + RemoveInternalTimer($hash); + InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWAD_GetValues", $hash, 1); + } + last; + }; + #-- alarm settings modified at runtime + $key =~ m/(.*)(Alarm|Low|High)/ and do { + #-- safeguard against uninitialized devices + return undef + if( $hash->{READINGS}{"state"}{VAL} eq "defined" ); + $ret = OWAD_Set($hash,($name,$key,$value)); + last; } - last; - }; - #-- alarm settings modified at runtime - $key =~ m/(.*)(Alarm|Low|High)/ and do { - #-- safeguard against uninitialized devices - return undef - if( $hash->{READINGS}{"state"}{VAL} eq "defined" ); - $ret = OWAD_Set($hash,($name,$key,$value)); - last; - }; + } } elsif ( $do eq "del" ) { - #-- should remove alarm setting, but does nothing so far - $key =~ m/(.*)(Alarm)/ and do { - last; - }; + ARGUMENT_HANDLER: { + #-- should remove alarm setting, but does nothing so far + $key =~ m/(.*)(Alarm)/ and do { + last; + } + } } return $ret; } diff --git a/fhem/FHEM/21_OWCOUNT.pm b/fhem/FHEM/21_OWCOUNT.pm index 25e1a4442..e0c336309 100644 --- a/fhem/FHEM/21_OWCOUNT.pm +++ b/fhem/FHEM/21_OWCOUNT.pm @@ -84,7 +84,7 @@ use strict; use warnings; sub Log($$); -my $owx_version="5.05"; +my $owx_version="5.06"; #-- fixed raw channel name, flexible channel name my @owg_fixed = ("A","B"); my @owg_channel = ("A","B"); @@ -270,18 +270,20 @@ sub OWCOUNT_Attr(@) { my $ret; if ( $do eq "set") { - #-- interval modified at runtime - $key eq "interval" and do { - #-- check value - return "OWCOUNT: Set with short interval, must be > 1" if(int($value) < 1); - #-- update timer - $hash->{INTERVAL} = $value; - if ($init_done) { - RemoveInternalTimer($hash); - InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWCOUNT_GetValues", $hash, 1); + ARGUMENT_HANDLER: { + #-- interval modified at runtime + $key eq "interval" and do { + #-- check value + return "OWCOUNT: Set with short interval, must be > 1" if(int($value) < 1); + #-- update timer + $hash->{INTERVAL} = $value; + if ($init_done) { + RemoveInternalTimer($hash); + InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWCOUNT_GetValues", $hash, 1); + } + last; } - last; - }; + } } return $ret; } diff --git a/fhem/FHEM/21_OWID.pm b/fhem/FHEM/21_OWID.pm index 1f6160765..806b609f0 100644 --- a/fhem/FHEM/21_OWID.pm +++ b/fhem/FHEM/21_OWID.pm @@ -53,7 +53,7 @@ use strict; use warnings; sub Log($$); -my $owx_version="5.05"; +my $owx_version="5.06"; #-- declare variables my %gets = ( "present" => "", @@ -217,18 +217,20 @@ sub OWID_Attr(@) { my $ret; if ( $do eq "set") { - #-- interval modified at runtime - $key eq "interval" and do { - #-- check value - return "OWID: Set with short interval, must be > 1" if(int($value) < 1); - #-- update timer - $hash->{INTERVAL} = $value; - if ($init_done) { - RemoveInternalTimer($hash); - InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWID_GetValues", $hash, 1); + ARGUMENT_HANDLER: { + #-- interval modified at runtime + $key eq "interval" and do { + #-- check value + return "OWID: Set with short interval, must be > 1" if(int($value) < 1); + #-- update timer + $hash->{INTERVAL} = $value; + if ($init_done) { + RemoveInternalTimer($hash); + InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWID_GetValues", $hash, 1); + } + last; } - last; - }; + } } return $ret; } diff --git a/fhem/FHEM/21_OWMULTI.pm b/fhem/FHEM/21_OWMULTI.pm index 6e3a4f112..1962be5c8 100644 --- a/fhem/FHEM/21_OWMULTI.pm +++ b/fhem/FHEM/21_OWMULTI.pm @@ -70,7 +70,7 @@ use strict; use warnings; sub Log($$); -my $owx_version="5.05"; +my $owx_version="5.06"; #-- flexible channel name my $owg_channel; @@ -156,18 +156,20 @@ sub OWMULTI_Attr(@) { my $ret; if ( $do eq "set") { - #-- interval modified at runtime - $key eq "interval" and do { - #-- check value - return "OWMULTI: Set with short interval, must be > 1" if(int($value) < 1); - #-- update timer - $hash->{INTERVAL} = $value; - if ($init_done) { - RemoveInternalTimer($hash); - InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWMULTI_GetValues", $hash, 1); + ARGUMENT_HANDLER: { + #-- interval modified at runtime + $key eq "interval" and do { + #-- check value + return "OWMULTI: Set with short interval, must be > 1" if(int($value) < 1); + #-- update timer + $hash->{INTERVAL} = $value; + if ($init_done) { + RemoveInternalTimer($hash); + InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWMULTI_GetValues", $hash, 1); + } + last; } - last; - }; + } } return $ret; } diff --git a/fhem/FHEM/21_OWSWITCH.pm b/fhem/FHEM/21_OWSWITCH.pm index b55501983..d1af56953 100644 --- a/fhem/FHEM/21_OWSWITCH.pm +++ b/fhem/FHEM/21_OWSWITCH.pm @@ -76,7 +76,7 @@ use strict; use warnings; sub Log($$); -my $owx_version="5.05"; +my $owx_version="5.06"; #-- fixed raw channel name, flexible channel name my @owg_fixed = ("A","B","C","D","E","F","G","H"); my @owg_channel = ("A","B","C","D","E","F","G","H"); @@ -278,18 +278,20 @@ sub OWSWITCH_Attr(@) { my $ret; if ( $do eq "set") { - #-- interval modified at runtime - $key eq "interval" and do { - #-- check value - return "OWSWITCH: Set with short interval, must be > 1" if(int($value) < 1); - #-- update timer - $hash->{INTERVAL} = $value; - if ($init_done) { - RemoveInternalTimer($hash); - InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWSWITCH_GetValues", $hash, 1); + ARGUMENT_HANDLER: { + #-- interval modified at runtime + $key eq "interval" and do { + #-- check value + return "OWSWITCH: Set with short interval, must be > 1" if(int($value) < 1); + #-- update timer + $hash->{INTERVAL} = $value; + if ($init_done) { + RemoveInternalTimer($hash); + InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWSWITCH_GetValues", $hash, 1); + } + last; } - last; - }; + } } return $ret; } diff --git a/fhem/FHEM/21_OWTHERM.pm b/fhem/FHEM/21_OWTHERM.pm index bb8b43898..b162abcf5 100755 --- a/fhem/FHEM/21_OWTHERM.pm +++ b/fhem/FHEM/21_OWTHERM.pm @@ -75,7 +75,7 @@ use warnings; sub Log($$); sub AttrVal($$$); -my $owx_version="5.05"; +my $owx_version="5.06"; my %gets = ( "id" => "", @@ -264,31 +264,33 @@ sub OWTHERM_Attr(@) { my $ret; if ( $do eq "set") { - #-- interval modified at runtime - $key eq "interval" and do { - #-- check value - return "OWTHERM: Set with short interval, must be > 1" if(int($value) < 1); - #-- update timer - $hash->{INTERVAL} = $value; + ARGUMENT_HANDLER: { + #-- interval modified at runtime + $key eq "interval" and do { + #-- check value + return "OWTHERM: Set with short interval, must be > 1" if(int($value) < 1); + #-- update timer + $hash->{INTERVAL} = $value; - if ($init_done) { - RemoveInternalTimer($hash); - InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWTHERM_GetValues", $hash, 1); - } - last; - }; - #-- resolution modified at runtime - $key eq "resolution" and do { - $hash->{owg_cf} = $value; - last; - }; - #-- alarm settings modified at runtime - $key =~ m/(.*)(Low|High)/ and do { - #-- safeguard against uninitialized devices - return undef - if( $hash->{READINGS}{"state"}{VAL} eq "defined" ); - $ret = OWTHERM_Set($hash,($name,$key,$value)); + if ($init_done) { + RemoveInternalTimer($hash); + InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWTHERM_GetValues", $hash, 1); + } + last; }; + #-- resolution modified at runtime + $key eq "resolution" and do { + $hash->{owg_cf} = $value; + last; + }; + #-- alarm settings modified at runtime + $key =~ m/(.*)(Low|High)/ and do { + #-- safeguard against uninitialized devices + return undef + if( $hash->{READINGS}{"state"}{VAL} eq "defined" ); + $ret = OWTHERM_Set($hash,($name,$key,$value)); + }; + } } return $ret; }