aos-r8-webview_v2-api-json-omniswitch
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
aos-r8-webview_v2-api-json-omniswitch [2020/11/17 14:56] – benny | aos-r8-webview_v2-api-json-omniswitch [2024/06/09 10:29] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 104: | Zeile 104: | ||
===== Verwendung der WebView 2.0 API ===== | ===== Verwendung der WebView 2.0 API ===== | ||
- | ==== Beispiel: Login und Ausgabe der Systemfunktionen ==== | + | ==== API: Login und Ausgabe der Systemfunktionen ==== |
+ | |||
+ | === Ausgabe in der CMD-Box/ | ||
+ | |||
+ | < | ||
+ | % python3 print_capabilities.py | ||
+ | OS6465T-P12 | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Quellcode für das obige Beispiel | ||
<file python print_capabilities.py> | <file python print_capabilities.py> | ||
Zeile 174: | Zeile 345: | ||
elif resp.json()[" | elif resp.json()[" | ||
for k, v in resp.json()[" | for k, v in resp.json()[" | ||
- | if isinstance(k, str): | + | if isinstance(v, str): |
print(v) | print(v) | ||
- | elif isinstance(k, dict): | + | elif isinstance(v, dict): |
print(json.dumps(v, | print(json.dumps(v, | ||
else: | else: | ||
Zeile 190: | Zeile 361: | ||
} | } | ||
</ | </ | ||
- | |||
- | |||
==== Weitere Beispiele auf GitHub ==== | ==== Weitere Beispiele auf GitHub ==== | ||
- | * a | + | * [[https:// |
- | * b | + | * [[https:// |
- | * c | + | * [[https:// |
+ | * [[https:// | ||
+ | * [[https:// | ||
aos-r8-webview_v2-api-json-omniswitch.1605625008.txt.gz · Zuletzt geändert: 2024/06/09 10:29 (Externe Bearbeitung)