set update intervall per attr
This commit is contained in:
parent
5094dda70b
commit
0051426f7f
@ -74,6 +74,7 @@ TadoAPI_Initialize($)
|
||||
$hash->{AttrList} =
|
||||
"homeID " .
|
||||
"mobileID " .
|
||||
"updateIntervall " .
|
||||
$main::readingFnAttributes;
|
||||
|
||||
}
|
||||
@ -123,7 +124,7 @@ sub TadoAPI_Define($$)
|
||||
|
||||
# start the status update timer
|
||||
RemoveInternalTimer($hash);
|
||||
InternalTimer( gettimeofday() + 10, "TadoAPI_Update", $hash, 0 );
|
||||
InternalTimer( gettimeofday() + 15, "TadoAPI_Update", $hash, 0 );
|
||||
|
||||
if ( defined($homeID) && $homeID ne "" ) {
|
||||
$attr{$name}{homeID} = $homeID;
|
||||
@ -511,15 +512,14 @@ sub TadoAPI_Update(@){
|
||||
|
||||
Log3 $name, 5, "TadoAPI $name" . ": " . "TadoAPI_Update called";
|
||||
|
||||
# timer loop
|
||||
#
|
||||
|
||||
my $nextTimer = "none";
|
||||
# if api online, try again in 5 minutes
|
||||
my $intervall = 300;
|
||||
$intervall = $attr{$name}{updateIntervall} if (defined($attr{$name}{updateIntervall}) && $attr{$name}{updateIntervall} =~ m/^-?\d+$/);
|
||||
# if api online, try again in xx minutes
|
||||
if ( $apiStatus ) {
|
||||
$nextTimer = gettimeofday() + 300;
|
||||
$nextTimer = gettimeofday() + $intervall;
|
||||
}
|
||||
|
||||
Log3 $name, 5, "TadoAPI $name" . ": " . "Next Timer = $nextTimer";
|
||||
RemoveInternalTimer($hash);
|
||||
InternalTimer( $nextTimer, "TadoAPI_Update", $hash, 0 );
|
||||
|
||||
@ -1383,9 +1383,9 @@ sub TadoAPI_readPassword($)
|
||||
<a name="TadoAPIdefine"></a>
|
||||
<b>Define</b>
|
||||
<ul>
|
||||
The username and password must match the username and password used on the Tado website.
|
||||
After successful define, store PASSWORD with set <name> password <your-tado-password>
|
||||
Password is sored in encrypted FHEM store. All requests to the API are via oauth2 token.<br>
|
||||
The username and password must match the username and password used on the Tado website.<br>
|
||||
After successful define, store PASSWORD with <code>set <name> password <your-tado-password></code>.<br>
|
||||
Note: Password is encrypted and saved in FHEM uniqueID file. All requests to the API are handeld via oauth2 token.<br>
|
||||
|
||||
Examples:
|
||||
<ul><code>
|
||||
|
Loading…
x
Reference in New Issue
Block a user