2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-02 06:55:26 +00:00

12_OilFox.pm: add timeout Attribute (Forum #109102)

git-svn-id: https://svn.fhem.de/fhem/trunk@28690 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2024-03-21 17:58:23 +00:00
parent 039e2653ac
commit 56de22e4c0

View File

@ -50,6 +50,7 @@ BEGIN {
modules modules
attr attr
AttrVal AttrVal
AttrNum
InternalTimer InternalTimer
RemoveInternalTimer RemoveInternalTimer
Log3 Log3
@ -87,6 +88,7 @@ sub Initialize($) {
"password " . "password " .
"oilfox " . "oilfox " .
"interval " . "interval " .
"timeout " .
$readingFnAttributes; $readingFnAttributes;
} }
@ -300,7 +302,7 @@ sub APIAuth($) {
HttpUtils_NonblockingGet({ HttpUtils_NonblockingGet({
url => API . "customer-api/v1/login", url => API . "customer-api/v1/login",
timeout => 5, timeout => AttrNum($name, "timeout", 45),
hash => $hash, hash => $hash,
method => "POST", method => "POST",
header => $header, header => $header,
@ -406,7 +408,7 @@ sub get($) {
HttpUtils_NonblockingGet({ HttpUtils_NonblockingGet({
url => API . "customer-api/v1/device", url => API . "customer-api/v1/device",
timeout => 5, timeout => AttrNum($name, "timeout", 45),
hash => $hash, hash => $hash,
method => "GET", method => "GET",
header => $header, header => $header,
@ -487,7 +489,7 @@ sub getResponse($) {
=item summary support for OilFox =item summary support for OilFox
=begin html =begin html
<a name="OilFox"></a> <a id="OilFox"></a>
<h3>OilFox</h3> <h3>OilFox</h3>
<ul> <ul>
<u><b>Requirements</b></u> <u><b>Requirements</b></u>
@ -497,7 +499,7 @@ sub getResponse($) {
</ul> </ul>
<br> <br>
<a name="OilFoxDefine"></a> <a id="OilFoxDefine"></a>
<b>Define</b> <b>Define</b>
<ul> <ul>
<code>define &lt;name&gt; OilFox</code> <code>define &lt;name&gt; OilFox</code>
@ -515,10 +517,10 @@ sub getResponse($) {
<br> <br>
<a name="OilFoxAttributes"></a> <a id="OilFox-attr"></a>
<b>Attributes</b> <b>Attributes</b>
<ul> <ul>
<li>username - Email that is used in OilFox App</li> <li>email - Email that is used in OilFox App</li>
<li>password - Password that is used in OilFox App</li> <li>password - Password that is used in OilFox App</li>
</ul> </ul>
<br> <br>
@ -526,6 +528,7 @@ sub getResponse($) {
<b>Optional attributes</b> <b>Optional attributes</b>
<ul> <ul>
<li>oilfox - ID of OilFox, if more that one is registered. Default: 0</li> <li>oilfox - ID of OilFox, if more that one is registered. Default: 0</li>
<li>timeout - Connection timeout</li>
<li>interval - Time in seconds that is used to get new data from OilFox Cloud. Default: 300</li> <li>interval - Time in seconds that is used to get new data from OilFox Cloud. Default: 300</li>
</ul> </ul>
<br> <br>