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

git-svn-id: https://svn.fhem.de/fhem/trunk@5035 2b470e98-0d58-463d-a4d8-8e2adae1ed80

This commit is contained in:
pahenning 2014-02-24 03:47:01 +00:00
parent 1ab4098a70
commit 64a261a24e
6 changed files with 110 additions and 96 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}