mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
git-svn-id: https://svn.fhem.de/fhem/trunk@4988 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1a23e2165a
commit
38d16b1043
@ -75,7 +75,7 @@ use warnings;
|
|||||||
sub Log($$);
|
sub Log($$);
|
||||||
sub AttrVal($$$);
|
sub AttrVal($$$);
|
||||||
|
|
||||||
my $owx_version="5.04";
|
my $owx_version="5.05";
|
||||||
|
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"id" => "",
|
"id" => "",
|
||||||
@ -264,32 +264,31 @@ sub OWTHERM_Attr(@) {
|
|||||||
my $ret;
|
my $ret;
|
||||||
|
|
||||||
if ( $do eq "set") {
|
if ( $do eq "set") {
|
||||||
ARGUMENT_HANDLER: {
|
#-- interval modified at runtime
|
||||||
#-- interval modified at runtime
|
$key eq "interval" and do {
|
||||||
$key eq "interval" and do {
|
#-- check value
|
||||||
#-- check value
|
return "OWTHERM: Set with short interval, must be > 1" if(int($value) < 1);
|
||||||
return "OWTHERM: Set with short interval, must be > 1" if(int($value) < 1);
|
#-- update timer
|
||||||
#-- update timer
|
$hash->{INTERVAL} = $value;
|
||||||
$hash->{INTERVAL} = $value;
|
|
||||||
if ($init_done) {
|
if ($init_done) {
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWTHERM_GetValues", $hash, 1);
|
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "OWTHERM_GetValues", $hash, 1);
|
||||||
}
|
}
|
||||||
last;
|
last;
|
||||||
};
|
};
|
||||||
#-- resolution modified at runtime
|
#-- resolution modified at runtime
|
||||||
$key eq "resolution" and do {
|
$key eq "resolution" and do {
|
||||||
$hash->{owg_cf} = $value;
|
$hash->{owg_cf} = $value;
|
||||||
last;
|
last;
|
||||||
};
|
};
|
||||||
#-- alarm settings modified at runtime
|
#-- alarm settings modified at runtime
|
||||||
$key =~ m/(.*)(Low|High)/ and do {
|
$key =~ m/(.*)(Low|High)/ and do {
|
||||||
#-- safeguard against uninitialized devices
|
#-- safeguard against uninitialized devices
|
||||||
return undef
|
return undef
|
||||||
if( $hash->{READINGS}{"state"}{VAL} eq "defined" );
|
if( $hash->{READINGS}{"state"}{VAL} eq "defined" );
|
||||||
$ret = OWTHERM_Set($hash,($name,$key,$value));
|
$ret = OWTHERM_Set($hash,($name,$key,$value));
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@ -432,9 +431,6 @@ sub OWTHERM_Get($@) {
|
|||||||
return "$name.version => $owx_version";
|
return "$name.version => $owx_version";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-- reset presence
|
|
||||||
$hash->{PRESENT} = 0;
|
|
||||||
|
|
||||||
#-- OWX interface
|
#-- OWX interface
|
||||||
if( $interface eq "OWX" ){
|
if( $interface eq "OWX" ){
|
||||||
#-- not different from getting all values ..
|
#-- not different from getting all values ..
|
||||||
@ -452,7 +448,6 @@ sub OWTHERM_Get($@) {
|
|||||||
if( defined($ret) ){
|
if( defined($ret) ){
|
||||||
return "OWTHERM: Could not get values from device $name, return was $ret";
|
return "OWTHERM: Could not get values from device $name, return was $ret";
|
||||||
}
|
}
|
||||||
$hash->{PRESENT} = 1;
|
|
||||||
|
|
||||||
#-- return the special reading
|
#-- return the special reading
|
||||||
if ($reading eq "temperature") {
|
if ($reading eq "temperature") {
|
||||||
@ -490,9 +485,6 @@ sub OWTHERM_GetValues($@) {
|
|||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
InternalTimer(time()+$hash->{INTERVAL}, "OWTHERM_GetValues", $hash, 1);
|
InternalTimer(time()+$hash->{INTERVAL}, "OWTHERM_GetValues", $hash, 1);
|
||||||
|
|
||||||
#-- reset presence
|
|
||||||
$hash->{PRESENT} = 0;
|
|
||||||
|
|
||||||
#-- Get values according to interface type
|
#-- Get values according to interface type
|
||||||
my $interface= $hash->{IODev}->{TYPE};
|
my $interface= $hash->{IODev}->{TYPE};
|
||||||
if( $interface eq "OWX" ){
|
if( $interface eq "OWX" ){
|
||||||
@ -517,7 +509,6 @@ sub OWTHERM_GetValues($@) {
|
|||||||
}
|
}
|
||||||
return "OWTHERM: Could not get values from device $name for ".$hash->{ERRCOUNT}." times, reason $ret";
|
return "OWTHERM: Could not get values from device $name for ".$hash->{ERRCOUNT}." times, reason $ret";
|
||||||
}
|
}
|
||||||
$hash->{PRESENT} = 1;
|
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@ -751,6 +742,9 @@ sub OWFSTHERM_GetValues($) {
|
|||||||
my $master = $hash->{IODev};
|
my $master = $hash->{IODev};
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
|
#-- reset presence
|
||||||
|
$hash->{PRESENT} = 0;
|
||||||
|
|
||||||
#-- resolution (set by Attribute 'resolution' on OWFS)
|
#-- resolution (set by Attribute 'resolution' on OWFS)
|
||||||
my $resolution = defined $hash->{owg_cf} ? $hash->{owg_cf} : "";
|
my $resolution = defined $hash->{owg_cf} ? $hash->{owg_cf} : "";
|
||||||
#-- get values - or should we rather get the uncached ones ?
|
#-- get values - or should we rather get the uncached ones ?
|
||||||
@ -769,6 +763,7 @@ sub OWFSTHERM_GetValues($) {
|
|||||||
$hash->{owg_th} = $ow_thn;
|
$hash->{owg_th} = $ow_thn;
|
||||||
|
|
||||||
#-- and now from raw to formatted values
|
#-- and now from raw to formatted values
|
||||||
|
$hash->{PRESENT} = 1;
|
||||||
my $value = OWTHERM_FormatValues($hash);
|
my $value = OWTHERM_FormatValues($hash);
|
||||||
Log 5, $value;
|
Log 5, $value;
|
||||||
return undef;
|
return undef;
|
||||||
@ -907,6 +902,7 @@ sub OWXTHERM_BinValues($$$$$$$$) {
|
|||||||
$hash->{owg_th} = $ow_thn;
|
$hash->{owg_th} = $ow_thn;
|
||||||
|
|
||||||
#-- and now from raw to formatted values
|
#-- and now from raw to formatted values
|
||||||
|
$hash->{PRESENT} = 1;
|
||||||
my $value = OWTHERM_FormatValues($hash);
|
my $value = OWTHERM_FormatValues($hash);
|
||||||
Log 5, $value;
|
Log 5, $value;
|
||||||
return undef;
|
return undef;
|
||||||
@ -929,9 +925,13 @@ sub OWXTHERM_GetValues($) {
|
|||||||
|
|
||||||
#-- ID of the device
|
#-- ID of the device
|
||||||
my $owx_dev = $hash->{ROM_ID};
|
my $owx_dev = $hash->{ROM_ID};
|
||||||
|
|
||||||
#-- hash of the busmaster
|
#-- hash of the busmaster
|
||||||
my $master = $hash->{IODev};
|
my $master = $hash->{IODev};
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
|
#-- reset presence
|
||||||
|
$hash->{PRESENT} = 0;
|
||||||
|
|
||||||
#-- check, if the conversion has been called before for all sensors
|
#-- check, if the conversion has been called before for all sensors
|
||||||
if( defined($attr{$name}{tempConv}) && ( $attr{$name}{tempConv} eq "onkick") ){
|
if( defined($attr{$name}{tempConv}) && ( $attr{$name}{tempConv} eq "onkick") ){
|
||||||
@ -1056,7 +1056,7 @@ sub OWXTHERM_SetValues($$) {
|
|||||||
<h4>Define</h4>
|
<h4>Define</h4>
|
||||||
<p>
|
<p>
|
||||||
<code>define <name> OWTHERM [<model>] <id> [<interval>]</code> or <br/>
|
<code>define <name> OWTHERM [<model>] <id> [<interval>]</code> or <br/>
|
||||||
<code>define <name> OWTHERM <fam>.lt;id> [<interval>]</code>
|
<code>define <name> OWTHERM <fam>.<id> [<interval>]</code>
|
||||||
<br /><br /> Define a 1-Wire digital thermometer device.</p>
|
<br /><br /> Define a 1-Wire digital thermometer device.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user