diff --git a/FHEM/59_Weather.pm b/FHEM/59_Weather.pm index d87bb5f..22b8925 100755 --- a/FHEM/59_Weather.pm +++ b/FHEM/59_Weather.pm @@ -1132,7 +1132,7 @@ sub Weather_CheckOptions { =item summary_DE stellt Wetterbericht und -vorhersage bereit =begin html - +
apt-get install
@@ -1148,8 +1148,8 @@ sub Weather_CheckOptions {
Such a virtual Weather device periodically gathers current and forecast
weather conditions from the chosen weather API.
-
- Define
+
+ Define
define <name> Weather [API=<API>[,<apioptions>]] [apikey=<apikey>]
[location=<location>] [interval=<interval>] [lang=<lang>]
@@ -1184,7 +1184,7 @@ sub Weather_CheckOptions {
API-specific documentation follows.
- Dark Sky
+
Dark Sky
API DarkSkyAPI
@@ -1197,7 +1197,7 @@ sub Weather_CheckOptions {
- OpenWeatherMap
+
OpenWeatherMap
API OpenWeatherMapAPI
@@ -1215,7 +1215,7 @@ sub Weather_CheckOptions {
- Wunderground
+
Wunderground
API wundergroundAPI
@@ -1247,17 +1247,19 @@ sub Weather_CheckOptions {
-
- Set
+
+ Set
+
-
-
set <name> update
+ set <name> update
Forces the retrieval of the weather data. The next automatic retrieval is scheduled to occur
interval
seconds later.
+
-
-
set <name> newLocation latitude,longitude
+ set <name> newLocation latitude,longitude
set a new temporary location.
the value pair Latitude Longitude is separated by a comma.
@@ -1266,39 +1268,65 @@ sub Weather_CheckOptions {
-
- Get
+
+ Get
get <name> <reading>
Valid readings and their meaning (? can be one of 1, 2, 3, 4, 5 and stands
for today, tomorrow, etc.):
@@ -1311,15 +1339,19 @@ sub Weather_CheckOptions {
-
- Attributes
+
+ Attributes
- - disable: disables the retrieval of weather data - the timer runs according to schedule,
+
+
- disable - disables the retrieval of weather data - the timer runs according to schedule,
though no data is requested from the API.
- readingFnAttributes
- - forecast - hourly/daily, display of forecast data.
- - forecastLimit - Number of forecast data records which should be written as a reading.
- - alerts - 0/1 should alert messages be written similar to Unwetterwarnung
+
+ - forecast - hourly/daily, display of forecast data.
+
+ - forecastLimit - Number of forecast data records which should be written as a reading.
+
+ - alerts - 0/1 should alert messages be written similar to Unwetterwarnung
@@ -1328,7 +1360,7 @@ sub Weather_CheckOptions {
=end html
=begin html_DE
-
+
Weather
Hinweis: es wird das Perl-Modul JSON benötigt. Mit apt-get install
@@ -1345,9 +1377,8 @@ sub Weather_CheckOptions {
Eine solche virtuelle Wetterstation sammelt periodisch aktuelle Wetterdaten
und Wettervorhersagen aus dem verwendeten API.
-
-
- Define
+
+ Define
define <name> Weather [API=<API>[,<apioptions>]] [apikey=<apikey>]
[location=<location>] [interval=<interval>] [lang=<lang>]
@@ -1383,7 +1414,7 @@ sub Weather_CheckOptions {
Es folgt die API-spezifische Dokumentation.
- Dark Sky
+
Dark Sky
API DarkSkyAPI
@@ -1397,7 +1428,7 @@ sub Weather_CheckOptions {
- OpenWeatherMap
+
OpenWeatherMap
API OpenWeatherMapAPI
@@ -1418,7 +1449,7 @@ sub Weather_CheckOptions {
- Wunderground
+
Wunderground
API wundergroundAPI
@@ -1455,55 +1486,76 @@ sub Weather_CheckOptions {
-
- Set
+
+ Set
- -
-
set <name> update
-
- Erzwingt eine Abfrage der Wetterdaten. Die darauffolgende Abfrage
- wird gemäß dem eingestellten
- Intervall interval
Sekunden später durchgeführt.
+
+ - set <name> update
+ Erzwingt eine Abfrage der Wetterdaten. Die darauffolgende Abfrage
+ wird gemäß dem eingestellten
+ Intervall interval
Sekunden später durchgeführt.
+
-
-
set <name> newLocation latitude,longitude
-
+ set <name> newLocation latitude,longitude
Gibt die Möglichkeit eine neue temporäre Location zu setzen.
Das Wertepaar Latitude Longitude wird durch ein Komma getrennt übergeben.
Wird kein Wert mitgegebn (leere Übergabe) wird automatisch die per Definition erkannte Location genommen
-
-
- Get
+
+ Get
get <name> <reading>
Gültige ausgelesene Daten (readings) und ihre Bedeutung (das ? kann einen der Werte 1, 2, 3 , 4 oder 5 annehmen und steht für heute, morgen, übermorgen etc.):
@@ -1515,16 +1567,20 @@ sub Weather_CheckOptions {
-
- Attribute
+
+ Attribute
- - disable: stellt die Abfrage der Wetterdaten ab - der Timer läft
+
+
- disable - stellt die Abfrage der Wetterdaten ab - der Timer läft
gemäß Plan doch es werden keine Daten vom
API angefordert.
- readingFnAttributes
- - forecast - hourly/daily, Anzeige von forecast Daten.
- - forecastLimit - Anzahl der Forecast-Datensätze welche als Reading geschrieben werden sollen.
- - alerts - 0/1 Sollen Alert Meldungen änlich Unwetterwarnung geschrieben werden.
+
+ - forecast - hourly/daily, Anzeige von forecast Daten.
+
+ - forecastLimit - Anzahl der Forecast-Datensätze welche als Reading geschrieben werden sollen.
+
+ - alerts - 0/1 Sollen Alert Meldungen änlich Unwetterwarnung geschrieben werden.
diff --git a/controls_Weather.txt b/controls_Weather.txt
index f8b3466..31a21f0 100644
--- a/controls_Weather.txt
+++ b/controls_Weather.txt
@@ -1,4 +1,4 @@
-UPD 2023-01-05_18:36:31 55320 FHEM/59_Weather.pm
+UPD 2023-01-07_13:19:38 57768 FHEM/59_Weather.pm
UPD 2023-01-04_16:37:24 49883 lib/FHEM/APIs/Weather/DarkSkyAPI.pm
-UPD 2023-01-05_19:39:00 33259 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
+UPD 2023-01-05_19:42:34 33259 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
UPD 2023-01-04_16:37:24 36090 lib/FHEM/APIs/Weather/wundergroundAPI.pm
diff --git a/hooks/commit-msg b/hooks/commit-msg
new file mode 100755
index 0000000..ae9eb2c
--- /dev/null
+++ b/hooks/commit-msg
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by "git commit" with one argument, the name of the file
+# that has the commit message. The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit. The hook is allowed to edit the commit message file.
+#
+# To enable this hook, rename this file to "commit-msg".
+
+# Uncomment the below to add a Signed-off-by line to the message.
+# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
+# hook is more suited to it.
+#
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+
+# This example catches duplicate Signed-off-by lines.
+
+commit_msg=$(cat "${1:?Missing commit message file}")
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
+ echo >&2 Duplicate Signed-off-by lines.
+ exit 1
+}
+
+if ! echo "$commit_msg" | grep -Eq "^(build|chore|ci|docs|feat|feat!|fix|perf|refactor|revert|style|test)(\(.+\))?: .*$" ; then
+
+ echo "Invalid commit message"
+
+ exit 1
+
+fi
+
+echo "Commit message is valid!"
diff --git a/hooks/post-commit b/hooks/post-commit
new file mode 100755
index 0000000..bf571f5
--- /dev/null
+++ b/hooks/post-commit
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -eu
+
+# destination of the final changelog file
+OUTPUT_FILE=CHANGELOG.md
+
+# generate the changelog
+git --no-pager log --no-merges --format="### %s%d%n>%aD%n%n>Author: %aN (%aE)%n%n>Commiter: %cN (%cE)%n%n%b%n%N%n" > $OUTPUT_FILE
+
+# prevent recursion!
+# since a 'commit --amend' will trigger the post-commit script again
+# we have to check if the changelog file has changed or not
+res=$(git status --porcelain | grep -c ".\$OUTPUT_FILE$")
+if [ "$res" -gt 0 ]; then
+ git add $OUTPUT_FILE
+ git commit --amend
+ echo "Populated Changelog in $OUTPUT_FILE"
+fi