[02_HTTPAPI.pm] zwei patch-Vorschläge

Begonnen von betateilchen, 30 Juli 2026, 19:31:55

Vorheriges Thema - Nächstes Thema

betateilchen

Hallo Klaus,

aus einem anderen Thread

Zitat von: betateilchen am 30 Juli 2026, 16:16:02Schön wäre, wenn HTTPAPI noch

$hash->{CanAuthenticate} = 1;
setzen würde, dann könnte man die entsprechenden devices auch direkt im allowed device anklicken.
Müsste man vielleicht mal dem Modulautor vorschlagen.

Deshalb schlage ich den folgenden patch vor:

Index: 02_HTTPAPI.pm
===================================================================
--- 02_HTTPAPI.pm       (revision 31520)
+++ 02_HTTPAPI.pm       (working copy)
@@ -40,6 +40,7 @@
   $hash->{UndefFn} = "HTTPAPI_Undef";
   $hash->{AttrList} = "disable:0,1 devicesCtrl " . $readingFnAttributes;
   $hash->{parseParams} = 1;
+  $hash->{CanAuthenticate} = 1;
   return undef;
 }
 
@@ -602,7 +603,7 @@
   <ul>
     <li>All links are relative to <code>http://&lt;ip-addr&gt;:&lt;port&gt;/</code>.</li>
     <li>Get und Set commands are not executed if the disable or ignore attribute of the device is set. See also <a href="#HTTPAPI-attr-devicesCtrl">devicesCtrl</a>.</li>
-    <li>Ecex commands are not executed if the disable attribute is set or command execution and device modification are not authorized by the permissions control. See the `validFor` attribute of the `allowed` module for more information.</li>
+    <li>Exec commands are not executed if the disable attribute is set or command execution and device modification are not authorized by the permissions control. See the `validFor` attribute of the `allowed` module for more information.</li>
     <li>The <code>http://&lt;ip-addr&gt;:&lt;port&gt;/&lt;apiName&gt;/</code> command displays the module-specific commandref.</li>
     <li>The response message is encoded to UTF-8.</li>
   </ul>

Der zweite Teil des patches behebt lediglich einen Buchstabendreher in der commandref.

Und wenn man bei der Gelegenheit gleich noch das Attribut "disabledForIntervals" in die Attributliste aufnehmen könnte, wäre das super. Das Attribut wir ja bei Verwendung von "IsDisabled()" automatisch mit geprüft.

Danke für wohlwollende Prüfung.
Viele Grüße, Udo
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

klaus.schauer


betateilchen

-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!