changed encoding of pm file; commandref created

This commit is contained in:
Philipp Wo 2019-11-23 11:49:06 +01:00
parent 7d4444ce58
commit 5094dda70b

View File

@ -1,4 +1,3 @@
#!/usr/bin/env perl
#=============================================================================== #===============================================================================
# #
# FILE: 98_TadoAPI.pm # FILE: 98_TadoAPI.pm
@ -21,11 +20,10 @@
# REVISION: 11/21/2019 05:17:22 PM # REVISION: 11/21/2019 05:17:22 PM
#=============================================================================== #===============================================================================
package main; package main;
use strict; use strict;
use warnings; use warnings;
use utf8; use utf8;
use FHEM::Meta;
use HTTP::Request::Common qw (POST GET PUT); use HTTP::Request::Common qw (POST GET PUT);
use HTTP::Headers; use HTTP::Headers;
use JSON; use JSON;
@ -273,7 +271,9 @@ sub TadoAPI_Get(@) {
$cmd eq "getXTest" and do { $cmd eq "getXTest" and do {
Log3 $name, 5, "TadoAPI $name" . ": " . "processing ($cmd)"; Log3 $name, 5, "TadoAPI $name" . ": " . "processing ($cmd)";
$message = "Name: " . TadoAPI_GetZoneNameById($hash, $value); my $zoneName = TadoAPI_GetZoneNameById($hash, $value);
$zoneName = "wrong Zone ID" unless $zoneName;
$message = "Name: " . $zoneName;
Log3 $name, 3, "TadoAPI $name" . ": " . "$cmd finished\n"; Log3 $name, 3, "TadoAPI $name" . ": " . "$cmd finished\n";
last; last;
}; };
@ -644,7 +644,7 @@ sub TadoAPI_UpdateFn(@){
url => $URL, url => $URL,
header => { "Content-Type"=>"application/json;charset=UTF-8","Authorization" => "$TokenData->{'token_type'} $TokenData->{'access_token'}" }, header => { "Content-Type"=>"application/json;charset=UTF-8","Authorization" => "$TokenData->{'token_type'} $TokenData->{'access_token'}" },
method => 'GET', method => 'GET',
timeout => 5, timeout => 10,
incrementalTimout => 1, incrementalTimout => 1,
callback => \&TadoAPI_UpdateMobileReadingsCallback, callback => \&TadoAPI_UpdateMobileReadingsCallback,
hash => $hash hash => $hash
@ -1365,34 +1365,73 @@ sub TadoAPI_readPassword($)
1; 1;
# Beginn der Commandref
=pod =pod
=item [device] =item helper
=item summary integration of the Tado API =item summary integration of the Tado API
=item summary_DE Anbindung der Tado Heizungssteuerung über API =item summary_DE Anbindung der Tado Heizungssteuerung über API
=begin html =begin html
<a name="TadoAPI"></a> <a name="TadoAPI"></a>
<h3>Tado</h3> <h3>TadoAPI</h3>
<ul> <ul>
<i>TadoAPI</i> implements an interface to the Tado cloud. Module to control the integration of tado devices with FHEM.<br>
<br><br> Notes:
<a name="Define"></a> <ul>
<li>JSON has to be installed on the FHEM host.</li>
</ul>
<a name="TadoAPIdefine"></a>
<b>Define</b> <b>Define</b>
<ul> <ul>
<code>define &lt;name&gt; TadoAPI &lt;tado-mailadress&gt; &lt;homeID&gt;</code>
<br><br>
Example: <code>define myTado TadoAPI mail@example.com 12345</code>
<br><br>
The username and password must match the username and password used on the Tado website. The username and password must match the username and password used on the Tado website.
After successful define, store PASSWORD with set myTado password &lt;yout-tado-password&gt; After successful define, store PASSWORD with set &lt;name&gt; password &lt;your-tado-password&gt;
Password is sored in encrypted FHEM store. All requests to the API are via oauth2 token. Password is sored in encrypted FHEM store. All requests to the API are via oauth2 token.<br>
</ul>
=end html Examples:
<ul><code>
define &lt;name&gt; TadoAPI mail@example.com [&lt;homeID&gt;]<br>
</code></ul>
<br>
</ul>
<a name="TadoAPIset"></a>
<b>Set</b>
<ul>
<li>
<code>set &lt;name&gt; &lt;tado password&gt;</code><br>
Stores <code>password</code> from tado account encrypted in FHEM.<br>
Without stored password all functions are blocked !<br>
IMPORTANT : if you rename the fhem Device you must set the password again!
</li>
<li>
<code>set &lt;name&gt; update</code><br>
Reloads all information from the tado installation (devices, battery state, geolocation,...).
</li>
<li>
<code>set &lt;name&gt; setZoneOverlay &lt;zoneID&gt; &lt;setting&gt;</code><br>
Setting: off delete overlay; 0 heating power off; &gt; 1 sets desired temperature to given value (overlay)
</li>
<li>
<code>set &lt;name&gt; setAllOverlays &lt;setting&gt;</code><br>
Same as above, but for all zones<br>
Setting: off delete overlay; 0 heating power off; &gt; 1 sets desired temperature to given value (overlay)</li>
<br>
</ul>
<br>
<a name="TadoAPIattr"></a>
<b>Attributes</b>
<ul>
<li>homeID<br>
Home ID that will be used for <b>API </b> querys.
</li>
</ul>
<br>
</ul>
=begin html_DE
-
=end html =end html
# Ende der Commandref # Ende der Commandref