AutomowerConnect: cref update, new events related to API errors
git-svn-id: https://svn.fhem.de/fhem/trunk@28960 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it
|
# Do not insert empty lines here, update check depends on it
|
||||||
|
- feature: 74_AutomowerConnect: new events for errors related to the APIs
|
||||||
- bugfix: 76_SolarForecast: Illegal division by zero
|
- bugfix: 76_SolarForecast: Illegal division by zero
|
||||||
- bufgix: 32_withings: improved token refresh timing
|
- bufgix: 32_withings: improved token refresh timing
|
||||||
- change: 38_netatmo: improved disconnect handling on auth failure
|
- change: 38_netatmo: improved disconnect handling on auth failure
|
||||||
|
|||||||
@@ -546,6 +546,18 @@ __END__
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<a id="AutomowerConnectEvents"></a>
|
||||||
|
<b>additional Events</b>
|
||||||
|
<ul>
|
||||||
|
A List of Events generated besides readings events.<br>
|
||||||
|
|
||||||
|
<li><code><device name>:AUTHENTIFICATION ERROR</code> Error during Authentification.</li>
|
||||||
|
<li><code><device name>:MOWERAPI ERROR</code> Error while Connecting AutomowerConnect API.</li>
|
||||||
|
<li><code><device name>:WEBSOCKET ERROR</code> Error related to websocket connection.</li>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
<a id="AutomowerConnectReadings"></a>
|
<a id="AutomowerConnectReadings"></a>
|
||||||
<b>Readings</b>
|
<b>Readings</b>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -1003,7 +1015,6 @@ __END__
|
|||||||
<li><a href="disabledForIntervals">disabledForIntervals</a></li>
|
<li><a href="disabledForIntervals">disabledForIntervals</a></li>
|
||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
|
||||||
|
|
||||||
|
|
||||||
<a id="AutomowerConnectUserAttr"></a>
|
<a id="AutomowerConnectUserAttr"></a>
|
||||||
@@ -1032,10 +1043,21 @@ __END__
|
|||||||
<code>attr <name> testing 1</code><br>
|
<code>attr <name> testing 1</code><br>
|
||||||
Macht Befehle verfügbar, die mit Testing markiert sind.</li><br>
|
Macht Befehle verfügbar, die mit Testing markiert sind.</li><br>
|
||||||
|
|
||||||
<br><br>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<a id="AutomowerConnectEvents"></a>
|
||||||
|
<b>zusätzliche Events</b>
|
||||||
|
<ul>
|
||||||
|
Eine Liste von Events zusätzlich zu den Readingsevents.<br>
|
||||||
|
|
||||||
|
<li><code><device name>:AUTHENTIFICATION ERROR</code> Fehler bei der Authentifizierung.</li>
|
||||||
|
<li><code><device name>:MOWERAPI ERROR</code> Fehler bei der Verbindung zur AutomowerConnect API.</li>
|
||||||
|
<li><code><device name>:WEBSOCKET ERROR</code> Fehler bei der Websocketverbindung.</li>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
<a id="AutomowerConnectReadings"></a>
|
<a id="AutomowerConnectReadings"></a>
|
||||||
<b>Readings</b>
|
<b>Readings</b>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ BEGIN {
|
|||||||
AttrVal
|
AttrVal
|
||||||
CommandAttr
|
CommandAttr
|
||||||
CommandDeleteReading
|
CommandDeleteReading
|
||||||
|
DoTrigger
|
||||||
FmtDateTime
|
FmtDateTime
|
||||||
FW_ME
|
FW_ME
|
||||||
FW_dir
|
FW_dir
|
||||||
@@ -808,6 +809,8 @@ sub APIAuthResponse {
|
|||||||
RemoveInternalTimer( $hash, \&APIAuth );
|
RemoveInternalTimer( $hash, \&APIAuth );
|
||||||
InternalTimer( gettimeofday() + $hash->{helper}{retry_interval_apiauth}, \&APIAuth, $hash, 0 );
|
InternalTimer( gettimeofday() + $hash->{helper}{retry_interval_apiauth}, \&APIAuth, $hash, 0 );
|
||||||
Log3 $name, 1, "$iam failed retry in $hash->{helper}{retry_interval_apiauth} seconds.";
|
Log3 $name, 1, "$iam failed retry in $hash->{helper}{retry_interval_apiauth} seconds.";
|
||||||
|
DoTrigger($name, "AUTHENTICATION ERROR");
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -962,12 +965,14 @@ sub getMowerResponse {
|
|||||||
|
|
||||||
readingsSingleUpdate( $hash, 'device_state', "error statuscode $statuscode", 1 );
|
readingsSingleUpdate( $hash, 'device_state', "error statuscode $statuscode", 1 );
|
||||||
Log3 $name, 1, "$iam \$statuscode >$statuscode<, \$err >$err<, \$param->url $param->{url} \n\$data >$data<";
|
Log3 $name, 1, "$iam \$statuscode >$statuscode<, \$err >$err<, \$param->url $param->{url} \n\$data >$data<";
|
||||||
|
DoTrigger($name, "MOWERAPI ERROR");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveInternalTimer( $hash, \&APIAuth );
|
RemoveInternalTimer( $hash, \&APIAuth );
|
||||||
InternalTimer( gettimeofday() + $hash->{helper}{retry_interval_getmower}, \&APIAuth, $hash, 0 );
|
InternalTimer( gettimeofday() + $hash->{helper}{retry_interval_getmower}, \&APIAuth, $hash, 0 );
|
||||||
Log3 $name, 1, "$iam failed retry in $hash->{helper}{retry_interval_getmower} seconds.";
|
Log3 $name, 1, "$iam failed retry in $hash->{helper}{retry_interval_getmower} seconds.";
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1092,6 +1097,8 @@ sub getMowerResponseWs {
|
|||||||
|
|
||||||
readingsSingleUpdate( $hash, 'device_state', "additional Polling error statuscode $statuscode", 1 );
|
readingsSingleUpdate( $hash, 'device_state', "additional Polling error statuscode $statuscode", 1 );
|
||||||
Log3 $name, 1, "$iam \$statuscode [$statuscode]\n\$err [$err],\n \$data [$data] \n\$param->url $param->{url}";
|
Log3 $name, 1, "$iam \$statuscode [$statuscode]\n\$err [$err],\n \$data [$data] \n\$param->url $param->{url}";
|
||||||
|
DoTrigger($name, "MOWERAPI ERROR");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1540,7 +1547,7 @@ sub Attr {
|
|||||||
|
|
||||||
readingsSingleUpdate( $hash,'device_state','disabled',1);
|
readingsSingleUpdate( $hash,'device_state','disabled',1);
|
||||||
RemoveInternalTimer( $hash );
|
RemoveInternalTimer( $hash );
|
||||||
DevIo_CloseDev( $hash ) if ( DevIo_IsOpen( $hash ) );
|
DevIo_CloseDev( $hash );
|
||||||
DevIo_setStates( $hash, "closed" );
|
DevIo_setStates( $hash, "closed" );
|
||||||
Log3 $name, 3, "$iam $cmd $attrName disabled";
|
Log3 $name, 3, "$iam $cmd $attrName disabled";
|
||||||
|
|
||||||
@@ -2982,7 +2989,10 @@ sub wsCb {
|
|||||||
my $type = $hash->{TYPE};
|
my $type = $hash->{TYPE};
|
||||||
my $iam = "$type $name wsCb:";
|
my $iam = "$type $name wsCb:";
|
||||||
my $l = $hash->{devioLoglevel};
|
my $l = $hash->{devioLoglevel};
|
||||||
Log3 $name, ( $l ? $l : 1 ), "$iam failed with error: $error" if( $error );
|
if( $error ){
|
||||||
|
Log3 $name, ( $l ? $l : 1 ), "$iam failed with error: $error";
|
||||||
|
DoTrigger($name, "WEBSOCKET ERROR");
|
||||||
|
}
|
||||||
return undef;
|
return undef;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user