From 1d0b9fccc3fa7ff2173611d6d96879948c3949cb Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 19 Aug 2016 12:47:50 +0000 Subject: [PATCH] contrib/commandref_modular.pl: implement modular commandref (Forum #39854) git-svn-id: https://svn.fhem.de/fhem/trunk@11984 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_CUL.pm | 2 + fhem/FHEM/00_FBAHA.pm | 2 + fhem/FHEM/00_FBAHAHTTP.pm | 2 + fhem/FHEM/00_FHZ.pm | 2 + fhem/FHEM/00_LIRC.pm | 2 + fhem/FHEM/00_ZWCUL.pm | 2 + fhem/FHEM/00_ZWDongle.pm | 2 + fhem/FHEM/01_FHEMWEB.pm | 12 +- fhem/FHEM/10_FBDECT.pm | 2 + fhem/FHEM/10_FS20.pm | 2 + fhem/FHEM/10_ZWave.pm | 2 + fhem/FHEM/11_FHT.pm | 2 + fhem/FHEM/11_FHT8V.pm | 2 + fhem/FHEM/12_HMS.pm | 2 + fhem/FHEM/13_KS300.pm | 2 + fhem/FHEM/14_CUL_TX.pm | 2 + fhem/FHEM/14_CUL_WS.pm | 2 + fhem/FHEM/15_CUL_EM.pm | 2 + fhem/FHEM/16_CUL_RFR.pm | 2 + fhem/FHEM/16_STACKABLE_CC.pm | 2 + fhem/FHEM/18_CUL_HOERMANN.pm | 2 + fhem/FHEM/60_EM.pm | 2 + fhem/FHEM/61_EMWZ.pm | 2 + fhem/FHEM/62_EMEM.pm | 2 + fhem/FHEM/63_EMGZ.pm | 2 + fhem/FHEM/90_at.pm | 2 + fhem/FHEM/91_eventTypes.pm | 2 + fhem/FHEM/91_notify.pm | 2 + fhem/FHEM/91_sequence.pm | 2 + fhem/FHEM/91_watchdog.pm | 2 + fhem/FHEM/92_FileLog.pm | 2 + fhem/FHEM/93_FHEM2FHEM.pm | 2 + fhem/FHEM/95_holiday.pm | 2 + fhem/FHEM/96_allowed.pm | 2 + fhem/FHEM/98_CULflash.pm | 2 + fhem/FHEM/98_JsonList2.pm | 3 + fhem/FHEM/98_SVG.pm | 2 + fhem/FHEM/98_XmlList.pm | 2 + fhem/FHEM/98_autocreate.pm | 10 +- fhem/FHEM/98_average.pm | 2 + fhem/FHEM/98_backup.pm | 2 + fhem/FHEM/98_cmdalias.pm | 2 + fhem/FHEM/98_dummy.pm | 2 + fhem/FHEM/98_fheminfo.pm | 2 + fhem/FHEM/98_notice.pm | 2 + fhem/FHEM/98_restore.pm | 2 + fhem/FHEM/98_structure.pm | 2 + fhem/FHEM/98_telnet.pm | 2 + fhem/FHEM/98_update.pm | 11 +- fhem/FHEM/98_weblink.pm | 2 + fhem/FHEM/99_SUNRISE_EL.pm | 2 + fhem/FHEM/99_Utils.pm | 2 + fhem/contrib/commandref_modular.pl | 110 +++++++++++++++++ fhem/docs/commandref_frame.html | 183 ++++++++++++++--------------- fhem/docs/commandref_frame_DE.html | 108 +++++++++++------ fhem/fhem.pl | 9 ++ fhem/www/pgm2/fhemdoc_modular.js | 166 ++++++++++++++++++++++++++ fhem/www/pgm2/smallscreenstyle.css | 1 + 58 files changed, 569 insertions(+), 140 deletions(-) create mode 100644 fhem/contrib/commandref_modular.pl create mode 100644 fhem/www/pgm2/fhemdoc_modular.js diff --git a/fhem/FHEM/00_CUL.pm b/fhem/FHEM/00_CUL.pm index ca4db2062..44c5ae4ba 100755 --- a/fhem/FHEM/00_CUL.pm +++ b/fhem/FHEM/00_CUL.pm @@ -1143,6 +1143,8 @@ CUL_prefix($$$) 1; =pod +=item summary connect devices with the culfw Firmware, e.g. Busware CUL +=item summary_DE Anbindung von Geraeten mit dem culfw Firmware, z.Bsp. Busware CUL =begin html diff --git a/fhem/FHEM/00_FBAHA.pm b/fhem/FHEM/00_FBAHA.pm index 2459e4dc3..f5af24b3c 100644 --- a/fhem/FHEM/00_FBAHA.pm +++ b/fhem/FHEM/00_FBAHA.pm @@ -395,6 +395,8 @@ FBAHA_Ready($) 1; =pod +=item summary (deprecated) connection to the Fritz!OS AHA Server +=item summary_DE Anbindung des (veralteten) Fritz!OS AHA Servers =begin html diff --git a/fhem/FHEM/00_FBAHAHTTP.pm b/fhem/FHEM/00_FBAHAHTTP.pm index 514ebfff2..d5591aaa2 100644 --- a/fhem/FHEM/00_FBAHAHTTP.pm +++ b/fhem/FHEM/00_FBAHAHTTP.pm @@ -228,6 +228,8 @@ FBAHAHTTP_Write($$$) 1; =pod +=item summary connection to the Fritz!OS AHA Server via HTTP +=item summary_DE Anbindung des Fritz!OS AHA Servers über HTTP =begin html diff --git a/fhem/FHEM/00_FHZ.pm b/fhem/FHEM/00_FHZ.pm index 87b4069c7..d5890a605 100755 --- a/fhem/FHEM/00_FHZ.pm +++ b/fhem/FHEM/00_FHZ.pm @@ -821,6 +821,8 @@ FHZ_Read($) 1; =pod +=item summary connection to the ELV FHZ1000/FHZ1300 USB devices +=item summary_DE Anbindung der ELV FHZ1000/FHZ1300 USB Geräte =begin html diff --git a/fhem/FHEM/00_LIRC.pm b/fhem/FHEM/00_LIRC.pm index de5154520..7304ac3a9 100644 --- a/fhem/FHEM/00_LIRC.pm +++ b/fhem/FHEM/00_LIRC.pm @@ -115,6 +115,8 @@ LIRC_Ready($) 1; =pod +=item summary connection to the Linux Infrared Server (lirc) +=item summary_DE Anbindung der Linux Infrared (lirc) Servers =begin html diff --git a/fhem/FHEM/00_ZWCUL.pm b/fhem/FHEM/00_ZWCUL.pm index 2c4ec5115..63f403d65 100755 --- a/fhem/FHEM/00_ZWCUL.pm +++ b/fhem/FHEM/00_ZWCUL.pm @@ -658,6 +658,8 @@ ZWCUL_Ready($) 1; =pod +=item summary connection to a culfw Device in ZWave mode (e.g. CUL) +=item summary_DE Anbindung eines culfw Gerätes in ZWave Modus (z.Bsp. CUL) =begin html diff --git a/fhem/FHEM/00_ZWDongle.pm b/fhem/FHEM/00_ZWDongle.pm index 6d8878e5e..a11e28b68 100755 --- a/fhem/FHEM/00_ZWDongle.pm +++ b/fhem/FHEM/00_ZWDongle.pm @@ -952,6 +952,8 @@ ZWDongle_Ready($) 1; =pod +=item summary connection to standard ZWave controller +=item summary_DE Anbindung von standard ZWave Controller =begin html diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 0ebf512da..d1d4bd80a 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -628,6 +628,8 @@ FW_answerCall($) my $static = ($ext =~ m/(css|js|png|jpg)/i || $dir =~ m/^pgm2/); my $fname = ($ext ? "$file.$ext" : $file); if(-r "$ldir/$fname" || $static) { # no return for FLOORPLAN + $FW_RET .= "var csrfToken='$FW_CSRF';\n" # Hack? + if($FW_CSRF && $fname eq "fhemdoc_modular.js"); return FW_serveSpecial($file, $ext, $ldir, ($arg =~ m/nocache/) ? 0 : 1); } $arg = "/$dir/$ofile"; @@ -1272,7 +1274,9 @@ FW_doDetail($) FW_pH "cmd=style showDSI $d", "Extend devStateIcon", undef, "detLink showDSI"; FW_pH "cmd=delete $d", "Delete this device ($d)", undef, "detLink delDev" if($d ne "global"); - FW_pH "$FW_ME/docs/commandref.html#${t}", "Device specific help", + my $sfx = AttrVal("global", "language", "EN"); + $sfx = ($sfx eq "EN" ? "" : "_$sfx"); + FW_pH "$FW_ME/docs/commandref${sfx}.html#${t}", "Device specific help", undef, "detLink devSpecHelp"; FW_pO "

"; FW_pO ""; @@ -1391,10 +1395,12 @@ FW_roomOverview($) push @list1, $lr; push @list2, "$FW_ME?room=".urlEncode($r); } + my $sfx = AttrVal("global", "language", "EN"); + $sfx = ($sfx eq "EN" ? "" : "_$sfx"); my @list = ( "Everything", "$FW_ME?room=all", "", "", - "Commandref", "$FW_ME/docs/commandref.html", + "Commandref", "$FW_ME/docs/commandref${sfx}.html", "Remote doc", "http://fhem.de/fhem.html#Documentation", "Edit files", "$FW_ME?cmd=style%20list", "Select style", "$FW_ME?cmd=style%20select", @@ -2989,6 +2995,8 @@ FW_widgetOverride($$) =pod =item helper +=item summary HTTP Server and FHEM Frontend +=item summary_DE HTTP Server und FHEM Frontend =begin html diff --git a/fhem/FHEM/10_FBDECT.pm b/fhem/FHEM/10_FBDECT.pm index 3bd293899..9e82fe728 100644 --- a/fhem/FHEM/10_FBDECT.pm +++ b/fhem/FHEM/10_FBDECT.pm @@ -477,6 +477,8 @@ FBDECT_Undef($$) 1; =pod +=item summary DECT devices connected via the Fritz!OS AHA Server +=item summary_DE über den Fritz!OS AHA Server angebundene DECT Geräte =begin html diff --git a/fhem/FHEM/10_FS20.pm b/fhem/FHEM/10_FS20.pm index 8f4c62bc4..19fe6fa16 100755 --- a/fhem/FHEM/10_FS20.pm +++ b/fhem/FHEM/10_FS20.pm @@ -455,6 +455,8 @@ four2hex($$) 1; =pod +=item summary devices communicating via the ELV FS20 protocol +=item summary_DE Anbindung von FS20 Geräten =begin html diff --git a/fhem/FHEM/10_ZWave.pm b/fhem/FHEM/10_ZWave.pm index bd22ce4f6..0650bdf8c 100755 --- a/fhem/FHEM/10_ZWave.pm +++ b/fhem/FHEM/10_ZWave.pm @@ -4548,6 +4548,8 @@ s2Hex($) 1; =pod +=item summary devices communicating via the ZWave protocol +=item summary_DE Anbindung von ZWave Geräten =begin html diff --git a/fhem/FHEM/11_FHT.pm b/fhem/FHEM/11_FHT.pm index 6c1257d80..33bc9298f 100755 --- a/fhem/FHEM/11_FHT.pm +++ b/fhem/FHEM/11_FHT.pm @@ -723,6 +723,8 @@ FHT_State($$$$) 1; =pod +=item summary devices communicating via the ELV FHT protocol (FHT80b) +=item summary_DE Anbindung von ELV FHT Geräten (FHT80b) =begin html diff --git a/fhem/FHEM/11_FHT8V.pm b/fhem/FHEM/11_FHT8V.pm index 9efb890ff..853ccee91 100755 --- a/fhem/FHEM/11_FHT8V.pm +++ b/fhem/FHEM/11_FHT8V.pm @@ -122,6 +122,8 @@ FHT8V_Get($@) 1; =pod +=item summary module for the FHT8v controlled directly by a culfw device +=item summary_DE Anbindung von FHT8v Ventilen über ein culfw Gerät =begin html diff --git a/fhem/FHEM/12_HMS.pm b/fhem/FHEM/12_HMS.pm index 522478b26..04086ab9f 100755 --- a/fhem/FHEM/12_HMS.pm +++ b/fhem/FHEM/12_HMS.pm @@ -240,6 +240,8 @@ HMS_Parse($$) 1; =pod +=item summary devices communicating via the ELV HMS protocol +=item summary_DE Anbindung von ELV HMS Geräten =begin html diff --git a/fhem/FHEM/13_KS300.pm b/fhem/FHEM/13_KS300.pm index ef443fc07..d6a2def05 100755 --- a/fhem/FHEM/13_KS300.pm +++ b/fhem/FHEM/13_KS300.pm @@ -322,6 +322,8 @@ KS300_windIndex($) 1; =pod +=item summary module for the ELV KS300 weather station +=item summary_DE Anbindung der ELV KS300 Wetterstation =begin html diff --git a/fhem/FHEM/14_CUL_TX.pm b/fhem/FHEM/14_CUL_TX.pm index 5f37d4ead..b82fdad6d 100644 --- a/fhem/FHEM/14_CUL_TX.pm +++ b/fhem/FHEM/14_CUL_TX.pm @@ -142,6 +142,8 @@ CUL_TX_Parse($$) =pod +=item summary Some Lacrosse sensors (TX-3TH, etc) +=item summary_DE Einige Lacrosse Sensoren (TX-3TH, usw.) =begin html diff --git a/fhem/FHEM/14_CUL_WS.pm b/fhem/FHEM/14_CUL_WS.pm index 8e1bcc357..fea41dbd3 100755 --- a/fhem/FHEM/14_CUL_WS.pm +++ b/fhem/FHEM/14_CUL_WS.pm @@ -364,6 +364,8 @@ CUL_WS_Attr(@) 1; =pod +=item summary devices communicating via the ELV WS protocol (S300TH, etc) +=item summary_DE Anbindung von ELV Geräten mit dem WS Protokoll (S300TH, usw.) =begin html diff --git a/fhem/FHEM/15_CUL_EM.pm b/fhem/FHEM/15_CUL_EM.pm index 44bde3cf4..afa707acf 100755 --- a/fhem/FHEM/15_CUL_EM.pm +++ b/fhem/FHEM/15_CUL_EM.pm @@ -277,6 +277,8 @@ CUL_EM_Parse($$) =pod +=item summary devices communicating via the ELV EM protocol (EM1000WZ, etc) +=item summary_DE Anbindung von ELV Geräten mit dem EM Protokoll (EM1000WZ, usw.) =begin html diff --git a/fhem/FHEM/16_CUL_RFR.pm b/fhem/FHEM/16_CUL_RFR.pm index b43708a82..e6047b240 100755 --- a/fhem/FHEM/16_CUL_RFR.pm +++ b/fhem/FHEM/16_CUL_RFR.pm @@ -149,6 +149,8 @@ CUL_RFR_AddPrefix($$) =pod +=item summary devices communicating over culfw RFR (SlowRF repeater) +=item summary_DE Anbindung von Geräten über ein culfw RFR (SlowRF repeater) =begin html diff --git a/fhem/FHEM/16_STACKABLE_CC.pm b/fhem/FHEM/16_STACKABLE_CC.pm index e64e90e65..e7b68b6fb 100644 --- a/fhem/FHEM/16_STACKABLE_CC.pm +++ b/fhem/FHEM/16_STACKABLE_CC.pm @@ -150,6 +150,8 @@ STACKABLE_CC_Undef($$) =pod +=item summary Busware Stackable CC (SCC) base module +=item summary_DE Busware Stackabble CC (SCC) basis Modul =begin html diff --git a/fhem/FHEM/18_CUL_HOERMANN.pm b/fhem/FHEM/18_CUL_HOERMANN.pm index dcea0626e..ca8c1d880 100755 --- a/fhem/FHEM/18_CUL_HOERMANN.pm +++ b/fhem/FHEM/18_CUL_HOERMANN.pm @@ -61,6 +61,8 @@ CUL_HOERMANN_Parse($$) 1; =pod +=item summary Hoermann Garage door opener (read-only) +=item summary_DE Hoermann Garagenfernbedienung (nur lesen) =begin html diff --git a/fhem/FHEM/60_EM.pm b/fhem/FHEM/60_EM.pm index 77c7889db..673cf4524 100755 --- a/fhem/FHEM/60_EM.pm +++ b/fhem/FHEM/60_EM.pm @@ -425,6 +425,8 @@ EmGetDevData($) 1; =pod +=item summary basis module for the ELV EM1010PC +=item summary_DE Anbindung der ELV EM1010PC =begin html diff --git a/fhem/FHEM/61_EMWZ.pm b/fhem/FHEM/61_EMWZ.pm index 3fec18387..d5ae12a83 100755 --- a/fhem/FHEM/61_EMWZ.pm +++ b/fhem/FHEM/61_EMWZ.pm @@ -185,6 +185,8 @@ EMWZ_Define($$) 1; =pod +=item summary EM1000WZ devices communicating over the EM1010PC +=item summary_DE EM1000WZ Geräte angebunden über ein EM1010PC =begin html diff --git a/fhem/FHEM/62_EMEM.pm b/fhem/FHEM/62_EMEM.pm index 1933e35b0..507ccb828 100755 --- a/fhem/FHEM/62_EMEM.pm +++ b/fhem/FHEM/62_EMEM.pm @@ -139,6 +139,8 @@ EMEM_Define($$) 1; =pod +=item summary EM1000EM devices communicating over the EM1010PC +=item summary_DE EM1000EM Geräte angebunden über ein EM1010PC =begin html diff --git a/fhem/FHEM/63_EMGZ.pm b/fhem/FHEM/63_EMGZ.pm index f39860240..8b858854f 100644 --- a/fhem/FHEM/63_EMGZ.pm +++ b/fhem/FHEM/63_EMGZ.pm @@ -172,6 +172,8 @@ EMGZ_Define($$) 1; =pod +=item summary EM1000GZ devices communicating over the EM1010PC +=item summary_DE EM1000GZ Geräte angebunden über ein EM1010PC =begin html diff --git a/fhem/FHEM/90_at.pm b/fhem/FHEM/90_at.pm index fca3ead15..40223b270 100755 --- a/fhem/FHEM/90_at.pm +++ b/fhem/FHEM/90_at.pm @@ -383,6 +383,8 @@ EOF 1; =pod +=item summary start an FHEM command at a later time +=item summary_DE FHEM Befehl zu einem späteren Zeitpunkt starten =item helper =begin html diff --git a/fhem/FHEM/91_eventTypes.pm b/fhem/FHEM/91_eventTypes.pm index c1b975894..80f886109 100755 --- a/fhem/FHEM/91_eventTypes.pm +++ b/fhem/FHEM/91_eventTypes.pm @@ -218,6 +218,8 @@ eventTypes_Get($@) =pod =item helper +=item summary collects FHEM Events to be used in frontends +=item summary_DE Sammelt FHEM Events fü die Frontends. =begin html diff --git a/fhem/FHEM/91_notify.pm b/fhem/FHEM/91_notify.pm index 165b98493..77871f12b 100755 --- a/fhem/FHEM/91_notify.pm +++ b/fhem/FHEM/91_notify.pm @@ -269,6 +269,8 @@ notify_fhemwebFn($$$$) =pod =item helper +=item summary execute a command upon receiving an event +=item summary_DE führt bei Events Anweisungen aus =begin html diff --git a/fhem/FHEM/91_sequence.pm b/fhem/FHEM/91_sequence.pm index 413aa73d0..1e64785b0 100755 --- a/fhem/FHEM/91_sequence.pm +++ b/fhem/FHEM/91_sequence.pm @@ -131,6 +131,8 @@ sequence_Undef($$) =pod =item helper +=item summary generate an event upon reception of a defined sequence of events +=item summary_DE generiert Event nach Empfang einer definierten Event-Sequenz =begin html diff --git a/fhem/FHEM/91_watchdog.pm b/fhem/FHEM/91_watchdog.pm index afa958b69..bf6167779 100755 --- a/fhem/FHEM/91_watchdog.pm +++ b/fhem/FHEM/91_watchdog.pm @@ -207,6 +207,8 @@ watchdog_Attr(@) =pod =item helper +=item summary execute a command, if no event is received within timeout +=item summary_DE führt Befehl aus, falls innerhalb des Timeouts kein Event empfangen wurde =begin html diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index f649a3e0c..7531d7419 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -1065,6 +1065,8 @@ FileLog_regexpFn($$) =pod =item helper +=item summary log events to a file +=item summary_DE schreibt Events in eine Logdatei =begin html diff --git a/fhem/FHEM/93_FHEM2FHEM.pm b/fhem/FHEM/93_FHEM2FHEM.pm index fd329ac0b..e9523c2c9 100755 --- a/fhem/FHEM/93_FHEM2FHEM.pm +++ b/fhem/FHEM/93_FHEM2FHEM.pm @@ -322,6 +322,8 @@ FHEM2FHEM_Set($@) =pod =item helper +=item summary connect two FHEM instances +=item summary_DE verbindet zwei FHEM Installationen =begin html diff --git a/fhem/FHEM/95_holiday.pm b/fhem/FHEM/95_holiday.pm index 71cfdbac7..2bb64c7eb 100755 --- a/fhem/FHEM/95_holiday.pm +++ b/fhem/FHEM/95_holiday.pm @@ -268,6 +268,8 @@ western_easter($) =pod =item helper +=item summary define holidays in a local file +=item summary_DE Urlaubs-/Feiertagskalender aus einer lokalen Datei =begin html diff --git a/fhem/FHEM/96_allowed.pm b/fhem/FHEM/96_allowed.pm index 0904e6886..d9bc30416 100755 --- a/fhem/FHEM/96_allowed.pm +++ b/fhem/FHEM/96_allowed.pm @@ -211,6 +211,8 @@ allowed_Attr(@) =pod =item helper +=item summary authorize command execution based on frontend +=item summary_DE authorisiert Befehlsausführung basierend auf dem Frontend =begin html diff --git a/fhem/FHEM/98_CULflash.pm b/fhem/FHEM/98_CULflash.pm index 8ce6946c7..706b90c10 100644 --- a/fhem/FHEM/98_CULflash.pm +++ b/fhem/FHEM/98_CULflash.pm @@ -97,6 +97,8 @@ CommandCULflash($$) =pod =item command +=item summary flash (USB-)CUL device with culfw +=item summary_DE USB-CUL Geräte mit Firmware versorgen (flashen) =begin html diff --git a/fhem/FHEM/98_JsonList2.pm b/fhem/FHEM/98_JsonList2.pm index ca965637e..30ca08904 100644 --- a/fhem/FHEM/98_JsonList2.pm +++ b/fhem/FHEM/98_JsonList2.pm @@ -130,6 +130,9 @@ CommandJsonList2($$) =pod =item command +=item summary show device data in JSON format +=item summary_DE zeigt Gerätedaten in JSON Format an + =begin html diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm index fc5e2af1f..6e56208ff 100755 --- a/fhem/FHEM/98_SVG.pm +++ b/fhem/FHEM/98_SVG.pm @@ -2319,6 +2319,8 @@ plotAsPng(@) =pod =item helper +=item summary draw an SVG-Plot based on FileLog or DbLog data +=item summary_DE malt ein SVG-Plot aus FileLog oder DbLog Daten =begin html diff --git a/fhem/FHEM/98_XmlList.pm b/fhem/FHEM/98_XmlList.pm index 91592c5e0..25aa3478a 100644 --- a/fhem/FHEM/98_XmlList.pm +++ b/fhem/FHEM/98_XmlList.pm @@ -108,6 +108,8 @@ CommandXmlList($$) =pod =item command +=item summary show device data in XML format +=item summary_DE zeigt Gerätedaten in XML Format an =begin html diff --git a/fhem/FHEM/98_autocreate.pm b/fhem/FHEM/98_autocreate.pm index 0d22e5812..698d6b887 100644 --- a/fhem/FHEM/98_autocreate.pm +++ b/fhem/FHEM/98_autocreate.pm @@ -656,13 +656,15 @@ autocreate_Attr(@) =pod =item helper +=item summary automatically create not yet defined FHEM devices +=item summary_DE Erzeugt FHEM-Geräte automatisch =begin html

autocreate

This command will scan the /dev directory for attached USB devices, and will try to identify them. With the argument scan you'll get back a list - of fhem commands to execute, with the argument create there will be no + of FHEM commands to execute, with the argument create there will be no feedback, and the devices will be created instead.

Note that switching a CUL to HomeMatic mode is still has to be done @@ -810,7 +812,7 @@ autocreate_Attr(@)

autocreate

Dieser Befehl durchsucht das /dev-Verzeichnis nach angeschlossenen USB-Geräten und versucht gleichzeitig sie zu identifizieren. Mit dem - Argument scan wird eine Liste von ausführbaren fhem-Befehlen + Argument scan wird eine Liste von ausführbaren FHEM-Befehlen zurückgegeben. Das Argument create gibt keine Liste o.ä. zurück, die Geräte werden stattdessen erzeugt.

diff --git a/fhem/FHEM/98_average.pm b/fhem/FHEM/98_average.pm index 037ce733a..26137f2d6 100644 --- a/fhem/FHEM/98_average.pm +++ b/fhem/FHEM/98_average.pm @@ -191,6 +191,8 @@ average_Notify($$) =pod =item helper +=item summary add avarage Readings to arbitrary devices +=item summary_DE berechnet Durchschnittswerte (als Readings) =begin html diff --git a/fhem/FHEM/98_backup.pm b/fhem/FHEM/98_backup.pm index d48f3406a..a0ac7b6ce 100644 --- a/fhem/FHEM/98_backup.pm +++ b/fhem/FHEM/98_backup.pm @@ -227,6 +227,8 @@ createArchiv($$) =pod =item command +=item summary create a backup of the FHEM installation +=item summary_DE erzeugt eine Sicherungsdatei der FHEM Installation =begin html diff --git a/fhem/FHEM/98_cmdalias.pm b/fhem/FHEM/98_cmdalias.pm index 86a5226ac..faf04ebde 100644 --- a/fhem/FHEM/98_cmdalias.pm +++ b/fhem/FHEM/98_cmdalias.pm @@ -100,6 +100,8 @@ CommandCmdAlias($$$) =pod =item command +=item summary create new commands or replace internal ones. +=item summary_DE neue FHEM Befehle definieren oder existierende ändern =begin html diff --git a/fhem/FHEM/98_dummy.pm b/fhem/FHEM/98_dummy.pm index 580b17c1c..c2651175b 100644 --- a/fhem/FHEM/98_dummy.pm +++ b/fhem/FHEM/98_dummy.pm @@ -70,6 +70,8 @@ dummy_Define($$) =pod =item helper +=item summary dummy device +=item summary_DE dummy Gerät =begin html diff --git a/fhem/FHEM/98_fheminfo.pm b/fhem/FHEM/98_fheminfo.pm index 315abec8b..9388af23f 100644 --- a/fhem/FHEM/98_fheminfo.pm +++ b/fhem/FHEM/98_fheminfo.pm @@ -235,6 +235,8 @@ _myDiv($$) =pod =item command +=item summary display information about the system and FHEM definitions +=item summary_DE zeigt Systeminformationen an =begin html diff --git a/fhem/FHEM/98_notice.pm b/fhem/FHEM/98_notice.pm index 3fe7ebce3..8f72ff1bd 100644 --- a/fhem/FHEM/98_notice.pm +++ b/fhem/FHEM/98_notice.pm @@ -587,6 +587,8 @@ notice_Read($$$) =pod =item command +=item summary read and confirm system messages +=item summary_DE Systemnachrichten anzeigen und bestätigen =begin html diff --git a/fhem/FHEM/98_restore.pm b/fhem/FHEM/98_restore.pm index 3a0c46ee8..29c45bb8a 100644 --- a/fhem/FHEM/98_restore.pm +++ b/fhem/FHEM/98_restore.pm @@ -91,6 +91,8 @@ restoreDir($$) =pod =item command +=item summary restore program files modified by the update command +=item summary_DE durch das update Befehl geänderte Programmdateien wiederherstellen =begin html diff --git a/fhem/FHEM/98_structure.pm b/fhem/FHEM/98_structure.pm index cb247d364..a75eef380 100755 --- a/fhem/FHEM/98_structure.pm +++ b/fhem/FHEM/98_structure.pm @@ -510,6 +510,8 @@ structure_Attr($@) =pod =item helper +=item summary organize/structure multiple devices +=item summary_DE mehrere Geräte zu einem zusammenfassen =begin html diff --git a/fhem/FHEM/98_telnet.pm b/fhem/FHEM/98_telnet.pm index 69ad18feb..0cd0aef42 100644 --- a/fhem/FHEM/98_telnet.pm +++ b/fhem/FHEM/98_telnet.pm @@ -423,6 +423,8 @@ telnet_ActivateInform($) =pod =item helper +=item summary telnet server for FHEM +=item summary_DE FHEM telnet Server =begin html diff --git a/fhem/FHEM/98_update.pm b/fhem/FHEM/98_update.pm index 43e8dbba6..303002652 100644 --- a/fhem/FHEM/98_update.pm +++ b/fhem/FHEM/98_update.pm @@ -283,7 +283,9 @@ doUpdate($$$$) } my $canJoin; - my $cj = "$root/contrib/commandref_join.pl"; + my $cmod = AttrVal('global', 'commandref', 'full'); + my $cj = "$root/contrib/commandref_". + ($cmod eq "full" ? "join":"modular").".pl"; if(-f $cj && -f "$root/docs/commandref_frame.html" && -w "$root/docs/commandref.html" && @@ -394,8 +396,9 @@ doUpdate($$$$) if($canJoin && $upd_needJoin && $curr == $max) { chdir($root); - uLog(1, "Calling $^X $cj -noWarnings, this may take a while"); - my $ret = `$^X $cj -noWarnings`; + $cj .= " -noWarnings" if($cmod eq "full"); + uLog(1, "Calling $^X $cj, this may take a while"); + my $ret = `$^X $cj`; foreach my $l (split(/[\r\n]+/, $ret)) { uLog(1, $l); } @@ -621,6 +624,8 @@ upd_initRestoreDirs($) =pod =item command +=item summary update FHEM program files from the central repository +=item summary_DE FHEM Programmdateien aktualisieren =begin html diff --git a/fhem/FHEM/98_weblink.pm b/fhem/FHEM/98_weblink.pm index 3b5bedce7..761722bf7 100755 --- a/fhem/FHEM/98_weblink.pm +++ b/fhem/FHEM/98_weblink.pm @@ -138,6 +138,8 @@ weblink_FwFn($$$$) =pod =item helper +=item summary define a HTTP link for the FHEMWEB frontend +=item summary_DE HTTP Link fuer das FHEMWEB Frontend =begin html diff --git a/fhem/FHEM/99_SUNRISE_EL.pm b/fhem/FHEM/99_SUNRISE_EL.pm index 00d53b4d0..2f4baf4bc 100755 --- a/fhem/FHEM/99_SUNRISE_EL.pm +++ b/fhem/FHEM/99_SUNRISE_EL.pm @@ -401,6 +401,8 @@ sub sunset_abs_dat (@) { =pod =item helper +=item summary perl functions to compute the sun position +=item summary_DE perl Funktionen für die Sonnenstandsberechnung =begin html diff --git a/fhem/FHEM/99_Utils.pm b/fhem/FHEM/99_Utils.pm index 69818941b..a475bc60e 100644 --- a/fhem/FHEM/99_Utils.pm +++ b/fhem/FHEM/99_Utils.pm @@ -248,6 +248,8 @@ round($$) =pod =item helper +=item summary FHEM utility functions +=item summary_DE FHEM Hilfsfunktionen =begin html diff --git a/fhem/contrib/commandref_modular.pl b/fhem/contrib/commandref_modular.pl new file mode 100644 index 000000000..f33891669 --- /dev/null +++ b/fhem/contrib/commandref_modular.pl @@ -0,0 +1,110 @@ +#!/usr/bin/perl + +# $Id$ + +use strict; +use warnings; + +my @lang = ("EN", "DE"); +my $modDir = "FHEM"; +my $now = time(); + +for my $lang (@lang) { + my $sfx = ($lang eq "EN" ? "" : "_$lang"); + my %modData; + my $cmdref = "docs/commandref_frame$sfx.html"; + + open(FH, $cmdref) || die("Cant open $cmdref: $!\n"); + my $type = ""; + while(my $l = ) { + if($l =~ m//) { + $type = $1; next; + } + if($type && $l =~ m//) { + $modData{$1}{type} = $type; + $modData{$1}{"summary$sfx"} = $2; + $modData{$1}{ts} = $now; + } else { + $type = ""; + } + } + close(FH); + + $cmdref = "docs/commandref${sfx}.html"; + if(open(FH, $cmdref)) { + my $cmptime = (stat($cmdref))[9]; + my $type = "device"; + while(my $l = ) { + $type = $1 if($l =~ m,,); + if($l =~ m,(.*)(.*), && + !$modData{$1}) { # commandref_frame has prio + $modData{$1}{type} = $type; + $modData{$1}{"summary$sfx"} = $2; + $modData{$1}{ts} = $cmptime; + } + } + close(FH); + } + + opendir(DH, $modDir) || die "Cant open $modDir: $!\n"; + while(my $fName = readdir DH) { + next if($fName !~ m/^\d\d_(.*)\.pm$/); + my $mName = $1; + my $ts = (stat("$modDir/$fName"))[9]; + if(!$modData{$mName} || !$modData{$mName}{ts} || $modData{$mName}{ts}<$ts) { + print "Checking $fName for $lang short description\n"; + + $modData{$mName}{type}="device" if(!$modData{$mName}{type}); + open(FH, "$modDir/$fName") || die("Cant open $modDir/$fName: $!\n"); + while(my $l = ) { + $modData{$mName}{type}=$1 if($l =~ m/^=item\s+(helper|command|device)/); + $modData{$mName}{$1} =$2 if($l =~ m/^=item\s+(summary[^ ]*)\s(.*)$/); + } + close(FH); + } + } + closedir(DH); + + $cmdref = "docs/commandref_frame${sfx}.html"; + open(IN, $cmdref) || die("Cant open $cmdref: $!\n"); + + $cmdref = ">docs/commandref${sfx}.html"; + open(OUT, $cmdref) || die("Cant open $cmdref: $!\n"); + + while(my $l = ) { + + print OUT $l; + if($l =~ m,\s*,) { + print OUT << 'EOF' + <script type="text/javascript" src="../pgm2/jquery.min.js"></script> + <script type="text/javascript" src="../pgm2/fhemdoc_modular.js"></script> +EOF + } + + if($l =~ m,<!-- header:(.*) -->,) { + my $type = $1; + while(my $l = <IN>) { + last if($l !~ m/<a href="/); + } + print OUT "<table class='block summary class_$type'>\n"; + my $rc = "odd"; + for my $m (sort keys %modData) { + next if(!$modData{$m}{type} || $modData{$m}{type} ne $type); + my $d = $modData{$m}{"summary$sfx"}; + if(!$d) { + my $osfx = ($lang eq "DE" ? "" : "_DE"); + $d = $modData{$m}{"summary$sfx"}; + if(!$d) { + $d = "keine Kurzbeschreibung vorhanden" if($lang eq "DE"); + $d = "no short description available" if($lang eq "EN"); + } + } + print OUT "<tr class='$rc'><td class='modname'><a href='#'>$m</a></td>". + "<td>$d</td><tr>\n"; + $rc = ($rc eq "odd" ? "even" : "odd"); + } + print OUT "</table>\n"; + } + + } +} diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html index 5022eb241..afd083fee 100644 --- a/fhem/docs/commandref_frame.html +++ b/fhem/docs/commandref_frame.html @@ -19,11 +19,21 @@ <div id="menu"> <h3>fhem.pl reference</h3> Version: <b>EN</b> <a href="commandref_DE.html">DE</a> + <br><br> + <a href="#doctop">Scroll to top</a> + <br><br> + <a style="display:none" href="#" name="loadAll">Load complete doc</a> + <br><br> + <a id="otherLang" style="display:none" href="#" name="otherLang"> + Load <span style="display:none" lang="DE">german</span> + <span style="display:none" lang="EN">english</span> + doc for <span class="mod"></span> + </a> </div> </div> <div id="right"> - +<a name="doctop"></a> <h3>Contents</h3> <ul> <a href="#intro">Introduction</a><br> @@ -35,38 +45,36 @@ <b>Fhem commands</b> <ul> <!-- header:command --> - <a href="#apptime">apptime</a>   - <a href="#attr">attr</a>   - <a href="#cancel">cancel</a>   - <a href="#createlog">createlog</a>   - <a href="#define">define</a>   - <a href="#defmod">defmod</a>   - <a href="#delete">delete</a>   - <a href="#deleteattr">deleteattr</a>   - <a href="#deletereading">deletereading</a>   - <a href="#displayattr">displayattr</a>   - <a href="#fheminfo">fheminfo</a>   - <a href="#get">get</a>   - <a href="#getstate">getstate</a>   - <a href="#IF">IF</a>   - <a href="#include">include</a>   - <a href="#inform">inform</a>   - <a href="#list">list</a>   - <a href="#modify">modify</a>   - <a href="#notice">notice</a>   - <a href="#quit">quit</a>   - <a href="#reload">reload</a>   - <a href="#rename">rename</a>   - <a href="#rereadcfg">rereadcfg</a>   - <a href="#save">save</a>   - <a href="#set">set</a>   - <a href="#setdefaultattr">setdefaultattr</a>   - <a href="#setreading">setreading</a>   - <a href="#setstate">setstate</a>   - <a href="#shutdown">shutdown</a>   - <a href="#sleep">sleep</a>   - <a href="#trigger">trigger</a>   - <a href="#usb">usb</a>   + <a href="#apptime">apptime</a>   <!-- provides information about execution times --> + <a href="#attr">attr</a>   <!-- set an attribute for a FHEM device --> + <a href="#cancel">cancel</a>   <!-- cancel sleep --> + <a href="#createlog">createlog</a>   <!-- add a FileLog and an SVG to an existing device --> + <a href="#define">define</a>   <!-- define/create a FHEM device --> + <a href="#defmod">defmod</a>   <!-- define or modify a FHEM device --> + <a href="#delete">delete</a>   <!-- delete a FHEM device --> + <a href="#deleteattr">deleteattr</a>   <!-- delete an attribute --> + <a href="#deletereading">deletereading</a>   <!-- delete a reading --> + <a href="#displayattr">displayattr</a>   <!-- show attributes --> + <a href="#get">get</a>   <!-- retrieve a value from a FHEM device --> + <a href="#IF">IF</a>   <!-- conditionally execute FHEM commands --> + <a href="#include">include</a>   <!-- read in a file with FHEM commands --> + <a href="#inform">inform</a>   <!-- show events in a telnet connection --> + <a href="#list">list</a>   <!-- display definition,readings and attributes of a FHEM device --> + <a href="#modify">modify</a>   <!-- change the definition of a FHEM device --> + <a href="#notice">notice</a>   <!-- view and confirm of system messages --> + <a href="#quit">quit</a>   <!-- end a telnet connection to FHEM --> + <a href="#reload">reload</a>   <!-- reload a FHEM module (program definition) --> + <a href="#rename">rename</a>   <!-- rename a FHEM device --> + <a href="#rereadcfg">rereadcfg</a>   <!-- reread the FHEM configuration --> + <a href="#save">save</a>   <!-- save the FHEM configuration --> + <a href="#set">set</a>   <!-- set a value in a FHEM device --> + <a href="#setdefaultattr">setdefaultattr</a>   <!-- define a default attribute --> + <a href="#setreading">setreading</a>   <!-- set a reading for a FHEM device --> + <a href="#setstate">setstate</a>   <!-- set the main state of a FHEM device --> + <a href="#shutdown">shutdown</a>   <!-- shut down (terminate) FHEM --> + <a href="#sleep">sleep</a>   <!-- sleep (delay execution) for a while --> + <a href="#trigger">trigger</a>   <!-- generate a FHEM event --> + <a href="#usb">usb</a>   <!-- discover USB devices --> </ul> @@ -685,34 +693,6 @@ The following local attributes are used by a wider range of devices: </ul> </ul> -<a name="setdefaultattr"></a> -<h3>setdefaultattr</h3> -<ul> - <code>setdefaultattr [<attrname> [<value>]] </code><br> - - <br>Add a default attribute. Each device defined from now on will receive - this attribute.<br> If no attrname is specified, then the default attribute - list will be deleted. - <br><br> - - Example to set the attribute "room kitchen" and "loglevel 4" to - each of the lamps: - <ul> - <code>setdefaultattr room kitchen</code><br> - <code>setdefaultattr loglevel 4</code><br> - <code>define lamp1 FS20 1234 11</code><br> - <code>define lamp2 FS20 1234 12</code><br> - <code>define lamp3 FS20 1234 13</code><br> - <code>setdefaultattr</code><br> - </ul> - <br> - - Notes:<br> - <ul> - <li>There is no way to delete a single default-attribute from the list</li> - </ul> -</ul> - <a name="cancel"></a> <h3>cancel</h3> <ul> @@ -871,26 +851,6 @@ The following local attributes are used by a wider range of devices: </ul> -<a name="getstate"></a> -<h3>getstate</h3> -<ul> - <code>getstate <devspec></code> - <br><br> - Output a short space seperated status for <devspec>. It is useful for - monitoring the device in e.g. Cacti.<br> - Examples: - <ul><code> - getstate lamp<br> - state:1<br> - <br> - getstate fl<br> - ack:0 actuator:2 day-temp:21.5 desired-temp:22.5 [...] measured-temp:22.9 [...] - </code></ul> - Note: to use this command copy the file contrib/getstate/99_getstate.pm into - your FHEM directory. - <br> - -</ul> <a name="include"></a> <h3>include</h3> @@ -1171,6 +1131,34 @@ The following local attributes are used by a wider range of devices: </ul> </ul> +<a name="setdefaultattr"></a> +<h3>setdefaultattr</h3> +<ul> + <code>setdefaultattr [<attrname> [<value>]] </code><br> + + <br>Add a default attribute. Each device defined from now on will receive + this attribute.<br> If no attrname is specified, then the default attribute + list will be deleted. + <br><br> + + Example to set the attribute "room kitchen" and "loglevel 4" to + each of the lamps: + <ul> + <code>setdefaultattr room kitchen</code><br> + <code>setdefaultattr loglevel 4</code><br> + <code>define lamp1 FS20 1234 11</code><br> + <code>define lamp2 FS20 1234 12</code><br> + <code>define lamp3 FS20 1234 13</code><br> + <code>setdefaultattr</code><br> + </ul> + <br> + + Notes:<br> + <ul> + <li>There is no way to delete a single default-attribute from the list</li> + </ul> +</ul> + <a name="setreading"></a> <h3>setreading</h3> <ul> @@ -1226,22 +1214,6 @@ The following local attributes are used by a wider range of devices: </ul> </ul> -<a name="trigger"></a> -<h3>trigger</h3> -<ul> - <code>trigger <devspec> <state></code> - <br><br> - Trigger a <a href="#notify">notify</a> definition. - See the <a href="#devspec">Device specification</a> section for details on - <devspec>. - - <br><br> - Example: - <ul> - <code>trigger btn3 on</code> - </ul> -</ul> - <a name="sleep"></a> <h3>sleep</h3> <ul> @@ -1271,6 +1243,22 @@ The following local attributes are used by a wider range of devices: <br> </ul> +<a name="trigger"></a> +<h3>trigger</h3> +<ul> + <code>trigger <devspec> <state></code> + <br><br> + Trigger a <a href="#notify">notify</a> definition. + See the <a href="#devspec">Device specification</a> section for details on + <devspec>. + + <br><br> + Example: + <ul> + <code>trigger btn3 on</code> + </ul> +</ul> + <!-- commands end - diese Zeile nicht entfernen! --> <a name="global"></a> @@ -1759,5 +1747,6 @@ The .gnuplot file consists of 3 parts: </ul> </li> +</div> <!-- right --> </body> </html> diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html index 0955f0cdd..be92cfc8a 100644 --- a/fhem/docs/commandref_frame_DE.html +++ b/fhem/docs/commandref_frame_DE.html @@ -19,10 +19,21 @@ <div id="menu"> <h3>fhem.pl Referenz</h3> Version: <a href="commandref.html">EN</a> <b>DE</b> + <br><br> + <a href="#doctop">Zum Anfang</a> + <br><br> + <a style="display:none" href="#" name="loadAll">Komplette Doku laden</a> + <br><br> + <a id="otherLang" style="display:none" href="#" name="otherLang"> + <span style="display:none" lang="DE">Deutsche</span> + <span style="display:none" lang="EN">Englische</span> + Doku für <span class="mod"></span> laden + </a> </div> </div> <div id="right"> +<a name="doctop"></a> <h3>Inhalt</h3> <ul> @@ -35,6 +46,36 @@ <b>FHEM-Befehle</b> <ul> <!-- header:command --> + <a href="#apptime">apptime</a>   <!-- liefert Daten über Ausführungszeiten --> + <a href="#attr">attr</a>   <!-- setzt ein Attribut für ein FHEM Gerät --> + <a href="#cancel">cancel</a>   <!-- bricht ein sleep ab --> + <a href="#createlog">createlog</a>   <!-- fügt ein FileLog und ein SVG an einem existierenden FHEM Gerät --> + <a href="#define">define</a>   <!-- definiert ein FHEM Gerät --> + <a href="#defmod">defmod</a>   <!-- definiert oder modifiziert ein FHEM Gerät --> + <a href="#delete">delete</a>   <!-- entfernt ein FHEM Gerät --> + <a href="#deleteattr">deleteattr</a>   <!-- entfernt ein Attribut --> + <a href="#deletereading">deletereading</a>   <!-- entfernt ein Reading --> + <a href="#displayattr">displayattr</a>   <!-- zeigt Attribute eines FHEM Gerätes --> + <a href="#get">get</a>   <!-- holt ein Wert von einem FHEM Gerät --> + <a href="#IF">IF</a>   <!-- bedingte Ausführung von FHEM Befehlen --> + <a href="#include">include</a>   <!-- liest eine Datei mit FHEM Befehlen ein --> + <a href="#inform">inform</a>   <!-- zeigt Events in einer telnet Verbindung --> + <a href="#list">list</a>   <!-- zeigt Definition,Readings und Attribute eines FHEM Gerätes --> + <a href="#modify">modify</a>   <!-- ändert die Definition eines FHEM Gerätes --> + <a href="#notice">notice</a>   <!-- zeigt und bestätigt Systemmeldungen --> + <a href="#quit">quit</a>   <!-- endet eine telnet Verbindung zu FHEM --> + <a href="#reload">reload</a>   <!-- lädt ein FHEM Modul (Programmdefinition) --> + <a href="#rename">rename</a>   <!-- benennt ein FHEM Gerät um --> + <a href="#rereadcfg">rereadcfg</a>   <!-- lädt die FHEM Konfiguration neu --> + <a href="#save">save</a>   <!-- speichert die FHEM Konfiguration --> + <a href="#set">set</a>   <!-- setzt ein Wert in einem FHEM Gerät --> + <a href="#setdefaultattr">setdefaultattr</a>   <!-- definiert ein "default" Attribut --> + <a href="#setreading">setreading</a>   <!-- setzt ein Reading für ein FHEM Gerät --> + <a href="#setstate">setstate</a>   <!-- setzt den Status eines FHEM Geräes --> + <a href="#shutdown">shutdown</a>   <!-- beendet FHEM --> + <a href="#sleep">sleep</a>   <!-- verzögerte Ausführung --> + <a href="#trigger">trigger</a>   <!-- generiert ein FHEM Event --> + <a href="#usb">usb</a>   <!-- sucht nach USB Geräten --> </ul> @@ -662,36 +703,6 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet: </ul> </ul> -<a name="setdefaultattr"></a> -<h3>setdefaultattr</h3> -<ul> - <code>setdefaultattr [<attrname> [<value>]] </code><br> - - <br> - Fügt Sie ein Standardattribut hinzu. Jedem nach dieser Zuweisung definierte - Gerät wird dieses Attribut zugewiesen. Wenn kein "attrname" angegeben wird, - dann wird die Liste der Standardattribute gelöscht. - <br><br> - - Beispiel, um das Attribut "room kitchen" und "loglevel 4" allen Lampen - zuzuweisen: - <ul> - <code>setdefaultattr room kitchen</code><br> - <code>setdefaultattr loglevel 4</code><br> - <code>define lamp1 FS20 1234 11</code><br> - <code>define lamp2 FS20 1234 12</code><br> - <code>define lamp3 FS20 1234 13</code><br> - <code>setdefaultattr</code><br> - </ul> - <br> - - Anmerkungen:<br> - <ul> - <li>es gibt keine Möglichkeit, ein einzelnes Standardattribut aus der Liste - tu löschen.</li> - </ul> -</ul> - <a name="cancel"></a> <h3>cancel</h3> <ul> @@ -1190,6 +1201,36 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet: </ul> </ul> +<a name="setdefaultattr"></a> +<h3>setdefaultattr</h3> +<ul> + <code>setdefaultattr [<attrname> [<value>]] </code><br> + + <br> + Fügt Sie ein Standardattribut hinzu. Jedem nach dieser Zuweisung definierte + Gerät wird dieses Attribut zugewiesen. Wenn kein "attrname" angegeben wird, + dann wird die Liste der Standardattribute gelöscht. + <br><br> + + Beispiel, um das Attribut "room kitchen" und "loglevel 4" allen Lampen + zuzuweisen: + <ul> + <code>setdefaultattr room kitchen</code><br> + <code>setdefaultattr loglevel 4</code><br> + <code>define lamp1 FS20 1234 11</code><br> + <code>define lamp2 FS20 1234 12</code><br> + <code>define lamp3 FS20 1234 13</code><br> + <code>setdefaultattr</code><br> + </ul> + <br> + + Anmerkungen:<br> + <ul> + <li>es gibt keine Möglichkeit, ein einzelnes Standardattribut aus der Liste + tu löschen.</li> + </ul> +</ul> + <a name="setreading"></a> <h3>setreading</h3> @@ -1840,7 +1881,6 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet: </ul> </li></ul> - - - -</div></body></html> +</div> <!-- right --> +</body> +</html> diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 419ac6e16..f978cf44f 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -273,6 +273,7 @@ my @globalAttrList = qw( backupdir backupsymlink blockingCallMax + commandref:modular,full configfile dnsServer dupTimeout @@ -2452,6 +2453,14 @@ GlobalAttr($$$$) $featurelevel = $val; } + elsif($name eq "commandref" && $init_done) { + my $root = $attr{global}{modpath}; + if($val eq "full") { + return `$^X $root/contrib/commandref_join.pl -noWarnings`; + } else { + return `$^X $root/contrib/commandref_modular.pl`; + } + } return undef; } diff --git a/fhem/www/pgm2/fhemdoc_modular.js b/fhem/www/pgm2/fhemdoc_modular.js new file mode 100644 index 000000000..876a92538 --- /dev/null +++ b/fhem/www/pgm2/fhemdoc_modular.js @@ -0,0 +1,166 @@ +var fd_Hash={}, fd_List=[], fd_All={}, fd_AllCnt, fd_Progress=0, fd_Lang, + fd_Offsets=[], scrolled=0; + + +function +fd_status(txt) +{ + var errmsg = $("#errmsg"); + if(!$(errmsg).length) { + $('#menuScrollArea').append('<div id="errmsg">'); + errmsg = $("#errmsg"); + } + if(txt == "") + $(errmsg).remove(); + else + $(errmsg).html(txt); +} + +function +fd_fC(fn, callback) +{ + var p = location.pathname; + var cmd = p.substr(0,p.indexOf('/doc'))+ + '?cmd='+fn+ + (typeof(csrfToken)!='undefined'?csrfToken:'')+ + '&XHR=1'; + var ax = $.ajax({ cache:false, url:cmd }); + ax.done(callback); + ax.fail(function(req, stat, err) { + console.log("FAIL ERR:"+err+" STAT:"+stat); + }); +} + +function +loadOneDoc(mname, lang) +{ + function + done(err, calc) + { + if(fd_Progress) { + fd_status(fd_Progress+" / "+fd_AllCnt); + if(++fd_Progress > fd_AllCnt) { + fd_Progress = 0; + setTimeout(calcOffsets,100); // Firefox returns wrong offsets + fd_status(""); + } + } else { + if(calc) + setTimeout(calcOffsets,100); + if(!err) + location.href = "#"+mname; + } + } + + if(fd_Hash[mname] && fd_Hash[mname] == lang) + return done(false, false); + + fd_fC("help "+mname+" "+lang, function(ret){ + //console.log(mname+" "+lang+" => "+ret.length); + if(ret.indexOf("<html>") != 0 || ret.indexOf("<html>No help found") == 0) + return done(true, false); + ret = ret.replace(/<\/?html>/g,''); + ret = ret.replace(/Keine deutsche Hilfe gefunden!<br\/>/,''); + ret = '<div id="FD_'+mname+'">'+ret+'</div>'; + + if(fd_Hash[mname]) + $("div#FD_"+mname).remove(); + + if(!fd_Hash[mname]) + fd_List.push(mname); + fd_Hash[mname] = lang; + fd_List.sort(); + var idx=0; + while(fd_List[idx] != mname) + idx++; + var toIns = "perl"; + if(idx < fd_List.length-1) + toIns = fd_List[idx+1]; + $(ret).insertBefore("a[name="+toIns+"]"); + console.log("insert "+mname+" before "+toIns); + return done(false, true); + }); +} + +function +calcOffsets() +{ + fd_Offsets=[]; + for(var i1=0; i1<fd_List.length; i1++) { + var cr = $("a[name="+fd_List[i1]+"]").offset(); + fd_Offsets.push(cr ? cr.top : -1); + } + checkScroll(); +} + +function +checkScroll() +{ + if(!scrolled) { + setTimeout(checkScroll, 500); + return; + } + scrolled = 0; + var viewTop=$(window).scrollTop(), viewBottom=viewTop+$(window).height(); + var idx=0; + while(idx<fd_Offsets.length) { + if(fd_Offsets[idx] >= viewTop && viewBottom > fd_Offsets[idx]+30) + break; + idx++; + } + + if(idx >= fd_Offsets.length) { + $("a#otherLang").hide(); + + } else { + var mname = fd_List[idx]; + var l1 = fd_Hash[mname], l2 = (l1=="EN" ? "DE" : "EN"); + $("a#otherLang span.mod").html(mname); + $("a#otherLang span[lang="+l1+"]").hide(); + $("a#otherLang span[lang="+l2+"]").show(); + $("a#otherLang").show(); + } +} + +function +loadOtherLang() +{ + var mname = $("a#otherLang span.mod").html(); + loadOneDoc(mname, fd_Hash[mname]=="EN" ? "DE" : "EN"); +} + +$(document).ready(function(){ + var p = location.pathname; + fd_Lang = p.substring(p.indexOf("commandref")+11,p.indexOf(".html")); + if(!fd_Lang || fd_Lang == '.') + fd_Lang = "EN"; + + $("h3").each(function(){ fd_Hash[$(this).html()] = fd_Lang; }); + $("table.summary td.modname a") + .each(function(){ fd_All[$(this).html()]=1; }) + .click(function(e){ + e.preventDefault(); + loadOneDoc($(this).html(), fd_Lang); + }); + + if(location.hash) + loadOneDoc(location.hash.substr(1), fd_Lang); + + $("a[name=loadAll]").show().click(function(e){ + e.preventDefault(); + $("a[name=loadAll]").hide(); + location.href = "#doctop"; + fd_AllCnt = 0; + for(var m in fd_All) fd_AllCnt++ + fd_Progress = 1; + for(var mname in fd_All) + loadOneDoc(mname, fd_Lang); + }); + + $("a#otherLang").click(loadOtherLang); + + window.onscroll = function(){ + if(!scrolled++) + setTimeout(checkScroll, 500); + }; +}); diff --git a/fhem/www/pgm2/smallscreenstyle.css b/fhem/www/pgm2/smallscreenstyle.css index 054ad42a5..9deb6d0a7 100644 --- a/fhem/www/pgm2/smallscreenstyle.css +++ b/fhem/www/pgm2/smallscreenstyle.css @@ -9,6 +9,7 @@ textarea { font-family:Arial, sans-serif; font-size:16px;} #menu { position:absolute; top: 2px; left:65px; } #hdr { position:absolute; top:40px; left:65px; } #content { position:absolute; top:85px; left: 0px; right: 0px;} +#right { position:absolute; top:30px; left: 0px; right: 0px; } #errmsg { left:0px; } .devType { font-size:12px;}