71 Commits

Author SHA1 Message Date
c75f865589 Merge pull request 'patch_login_autodisable_api' (#108) from patch_login_autodisable_api into dev
Reviewed-on: #108
2024-05-22 19:10:36 +02:00
9412aac176 fix: disable after 5 attemps 2024-05-22 18:46:38 +02:00
ae437a09f2 fix: push 2024-05-22 18:40:04 +02:00
640a7544d7 fix: api und disablle 2024-05-22 18:15:35 +02:00
f38236f721 fix: intervall 180 sek add useragent 2024-05-21 22:45:49 +02:00
517f033ccc fix: api call, login limit, disable 2024-05-21 10:31:30 +02:00
03b2130625 fix: api call,rate limit 2024-05-21 10:29:07 +02:00
90a561be10 Merge pull request 'dev' (#103) from dev into testing
Reviewed-on: #103
2024-04-15 15:58:49 +02:00
69d7681a28 Merge pull request 'patch-merge2' (#105) from patch-merge2 into dev
Reviewed-on: #105
2024-04-15 15:58:25 +02:00
5e60969fc4 fix: merge branch
Merge branch 'patch-merge' into patch-merge2
2024-04-15 15:57:29 +02:00
2d756e4aaa Merge pull request 'testing' (#104) from testing into main
Reviewed-on: #104
2024-04-15 15:48:53 +02:00
80147631d6 Merge pull request 'docs: change copyright year' (#102) from patch-merge into dev
Reviewed-on: #102
2024-04-15 15:46:41 +02:00
8b66df8407 docs: change copyright year
Ticket: no
2024-04-15 15:45:33 +02:00
fc3740fe9b Merge pull request 'fix: version push' (#100) from patch_valve_hhhdg into dev
Reviewed-on: #100
2024-04-15 09:38:54 +02:00
03ad7e3fba fix: version push 2024-04-15 09:38:16 +02:00
dfea4716d3 Merge pull request 'fix: patch code scheduling by hhhdg' (#99) from patch_valve_hhhdg into dev
Reviewed-on: #99
2024-04-15 09:36:13 +02:00
f9661f6452 fix: patch code scheduling by hhhdg 2024-04-15 09:32:51 +02:00
b41e583a9e Merge pull request 'docs: new CHANGELOG' (#98) from patch-tetsing into testing
Reviewed-on: #98
2024-03-28 12:42:10 +01:00
5138e6b3b0 docs: new CHANGELOG 2024-03-28 12:41:42 +01:00
89bc35b1bd Merge pull request 'dev' (#97) from dev into testing
Reviewed-on: #97
2024-03-28 08:16:03 +01:00
03e79bc782 Merge pull request 'patch_mucki_gwoffline' (#96) from patch_mucki_gwoffline into dev
Reviewed-on: #96
2024-03-28 06:06:33 +01:00
74635dfd0a controls_GardenaSmartDevice.txt aktualisiert 2024-03-28 06:05:59 +01:00
443ecd7776 controls_GardenaSmartDevice.txt aktualisiert 2024-03-28 05:59:55 +01:00
bbb4be939c Merge pull request 'patch_newstart_command' (#94) from patch_newstart_command into dev
Reviewed-on: #94
2024-03-27 20:03:15 +01:00
72daa71daf fix: put to post 2024-03-18 10:15:25 +01:00
68f66c8430 test: new api start cmd 2024-03-17 20:58:13 +01:00
579f632990 test: catch null value 2024-02-23 22:52:25 +01:00
790d5206b6 fix: fix 2024-02-21 22:00:02 +01:00
2c94924e97 fix: push version 2024-02-21 21:58:05 +01:00
918f4dc6a3 test: fix error spam 2024-02-21 21:56:14 +01:00
f14d34c1b4 Merge pull request 'dev' (#92) from dev into main
Reviewed-on: #92
2023-11-28 08:54:39 +01:00
274cb067cf Merge pull request 'patch-fix_div_with_attributes' (#91) from patch-fix_div_with_attributes into dev
Reviewed-on: #91
2023-11-28 08:54:09 +01:00
897a3c7aef fix: closes #90 2023-11-28 08:52:33 +01:00
232f82eafe Merge pull request 'testing' (#89) from testing into main
Reviewed-on: #89
2023-11-28 08:34:50 +01:00
9c49aa49b9 Merge pull request 'dev' (#88) from dev into testing
Reviewed-on: #88
2023-11-28 08:34:14 +01:00
24db680413 Merge pull request 'patch_mucki' (#87) from patch_mucki into dev
Reviewed-on: #87
Reviewed-by: Marko Oldenburg <marko@noreply@cooltux.net>
2023-11-20 20:43:36 +01:00
df1830a670 fix: missing tree 2023-11-12 19:47:49 +01:00
de58578a2d test: smartdevice variable wintermode initializied
Bridge consolidiert wifi/ethernet
2023-11-05 21:52:24 +01:00
e15a70ff0b test: fix initial variables 2023-11-01 21:04:39 +01:00
98b093bcba test: debug line 2023-10-28 18:02:17 +02:00
82907c73a3 test: cleanup initial error handling 2023-10-25 22:16:26 +02:00
13de67f570 test: fix wifi status if is_connected 2023-10-23 22:04:31 +02:00
7385959b38 test: changed published gateway informations 2023-10-21 20:21:31 +02:00
7dfa0b2dda test: gateway readings changed by gardena 2023-10-12 21:52:51 +02:00
abb325b448 test: versions pump 2023-10-03 22:40:58 +02:00
d7d5e4f843 Merge pull request 'dev' (#86) from dev into testing
Reviewed-on: #86
2023-03-15 18:17:18 +01:00
c0dec3d3fb Merge pull request 'patch_setExtention' (#85) from patch_setExtention into dev
Reviewed-on: #85
2023-03-15 18:15:48 +01:00
3e540471d5 feat: changelog 2023-03-02 11:58:58 +01:00
608719ba2f feat: add setextention 2023-03-02 11:58:29 +01:00
472fe88ac0 feat: test 2023-03-02 11:30:19 +01:00
682dea8bd1 Merge pull request 'testing' (#83) from testing into main
Reviewed-on: #83
2023-01-10 10:01:11 +01:00
fb3a690993 Merge pull request 'dev' (#82) from dev into testing
Reviewed-on: #82
2023-01-10 10:00:38 +01:00
2cae1812d8 Merge pull request 'patch-changeVersion' (#81) from patch-changeVersion into dev
Reviewed-on: #81
2023-01-10 10:00:15 +01:00
2111939863 docs: add changelog file 2023-01-10 09:51:23 +01:00
c9a3cc9e1d docs: change verson numbers
change modul versions
2023-01-10 09:50:36 +01:00
b399fcd524 test: add hooks
hooks for commit test and create changelog
2023-01-10 09:48:39 +01:00
89bbb4bb10 Merge branch 'main' of git.cooltux.net:/FHEM/mod-GardenaSmart 2023-01-10 09:29:11 +01:00
801a1a468f Merge pull request 'testing' (#80) from testing into main
Reviewed-on: #80
2022-12-22 08:04:47 +01:00
eddcb708ba Merge pull request 'dev' (#79) from dev into testing
Reviewed-on: #79
Reviewed-by: Marko Oldenburg <marko@noreply@cooltux.net>
2022-11-14 20:34:36 +01:00
c7073b24b4 Merge pull request 'patch-fix_commandref_spell' (#78) from patch-fix_commandref_spell into dev
Reviewed-on: #78
Reviewed-by: Marko Oldenburg <marko@noreply@cooltux.net>
2022-10-14 09:01:55 +02:00
fe97f0b203 [translaten] - add commandref translation 2022-09-18 08:52:43 +02:00
eebe13bb7b spellcheck + corrections 2022-09-06 14:34:38 +02:00
a6174d9982 Merge pull request 'dev' (#77) from dev into testing
Reviewed-on: #77
Reviewed-by: Marko Oldenburg <marko@noreply@cooltux.net>
2022-09-06 14:26:24 +02:00
aea73bb010 Merge pull request 'patch-wc_rest_valve_and_additinal_commandref' (#76) from patch-wc_rest_valve_and_additinal_commandref into dev
Reviewed-on: #76
Reviewed-by: Marko Oldenburg <marko@noreply@cooltux.net>
2022-09-06 13:32:06 +02:00
4cb9f2e50b Merge pull request 'dev' (#74) from dev into testing
Reviewed-on: #74
Reviewed-by: Marko Oldenburg <marko@noreply@cooltux.net>
2022-09-06 13:31:53 +02:00
b61c32a850 [enhancement] - commandref 2022-09-06 12:32:40 +02:00
8c49aaa079 [enhancement] - commandref 2022-08-30 16:23:00 +02:00
1f54fc7601 [test] commandref 2022-08-28 20:11:11 +02:00
3dd4796e14 [try] - to setup cmdref to set webui 2022-08-23 15:04:06 +02:00
7b188e3e41 [add] - wc reset valve, commandref 2022-08-23 11:24:21 +02:00
ebb342d83f Merge branch 'dev' of git.cooltux.net:/FHEM/mod-GardenaSmart 2022-07-13 07:20:49 +02:00
7 changed files with 5267 additions and 512 deletions

View File

@ -1 +1 @@
[enhancement] - add resetvalveerrors ic24
spellcheck + corrections

4243
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#
# Developed with VSCodium and richterger perl plugin.
#
# (c) 2017-2022 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
# (c) 2017-2024 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
# All rights reserved
#
# Special thanks goes to comitters:
@ -205,6 +205,7 @@ sub Define {
my $hash = shift // return;
my $aArg = shift // return;
return $@ unless ( FHEM::Meta::SetInternals($hash) );
use version 0.60; our $VERSION = FHEM::Meta::Get( $hash, 'version' );
@ -221,8 +222,9 @@ sub Define {
$hash->{URL} =
AttrVal( $name, 'gardenaBaseURL', 'https://smart.gardena.com' ) . '/v1';
$hash->{VERSION} = version->parse($VERSION)->normal;
$hash->{INTERVAL} = 60;
$hash->{INTERVAL} = 180;
$hash->{NOTIFYDEV} = "global,$name";
$hash->{helper}{gettoken_count} = 0;
CommandAttr( undef, $name . ' room GardenaSmart' )
if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
@ -264,6 +266,8 @@ sub Attr {
if ( $cmd eq 'set' && $attrVal eq '1' ) {
RemoveInternalTimer( $hash,
"FHEM::GardenaSmartBridge::getDevices" );
RemoveInternalTimer( $hash,
"FHEM::GardenaSmartBridge::getToken" );
readingsSingleUpdate( $hash, 'state', 'inactive', 1 );
Log3 $name, 3, "GardenaSmartBridge ($name) - disabled";
}
@ -290,14 +294,14 @@ sub Attr {
if ( $attrVal == 0 );
RemoveInternalTimer( $hash,
"FHEM::GardenaSmartBridge::getDevices" );
$hash->{INTERVAL} = $attrVal;
$hash->{INTERVAL} = $attrVal if $attrVal >= 180;
Log3 $name, 3,
"GardenaSmartBridge ($name) - set interval: $attrVal";
}
elsif ( $cmd eq 'del' ) {
RemoveInternalTimer( $hash,
"FHEM::GardenaSmartBridge::getDevices" );
$hash->{INTERVAL} = 60;
$hash->{INTERVAL} = 180;
Log3 $name, 3,
"GardenaSmartBridge ($name) - delete User interval and set default: 60";
}
@ -441,7 +445,9 @@ sub Set {
return "usage: $cmd" if ( scalar( @{$aArg} ) != 2 );
my $new_helper = $aArg->[0];
my $new_helper_value = $aArg->[1];
Log3( $name, 5, "[DEBUG] - GardenaSmartBridge ($name) - override helper $new_helper with $new_helper_value");
Log3( $name, 5,
"[DEBUG] - GardenaSmartBridge ($name) - override helper $new_helper with $new_helper_value"
);
$hash->{helper}{$new_helper} = $new_helper_value;
}
else {
@ -611,8 +617,7 @@ sub ErrorHandling {
}
if (
$data =~ /Error/
&& $data !~ /lastLonaErrorCode/
$data =~ /Error/ && $data !~ /lastLonaErrorCode/
|| ( defined($decode_json)
&& ref($decode_json) eq 'HASH'
&& defined( $decode_json->{errors} ) )
@ -627,8 +632,14 @@ sub ErrorHandling {
if ( $param->{code} == 400 ) {
if ($decode_json) {
if ( ref( $decode_json->{errors} ) eq "ARRAY"
&& defined( $decode_json->{errors} ) )
&& exists( $decode_json->{errors} ) )
# replace defined with exists
# && defined( $decode_json->{errors} ) )
{
# $decode_json->{errors} -> ARRAY
# $decode_json->{errors}[0] -> HASH
if ( exists( $decode_json->{errors}[0]{error} ) ) {
readingsBulkUpdate(
$dhash,
"state",
@ -647,6 +658,7 @@ sub ErrorHandling {
"GardenaSmartBridge ($dname) - RequestERROR: "
. $decode_json->{errors}[0]{error} . " "
. $decode_json->{errors}[0]{attribute};
} # fi exists error
}
}
else {
@ -683,6 +695,16 @@ sub ErrorHandling {
"GardenaSmartBridge ($dname) - RequestERROR: check the ???";
}
elsif ( $decode_json->{errors}[0]{code} eq "ratelimit.exceeded" ) {
Log3 $name, 5,
"GardenaSmartBridge ($name) - RequestERROR: error ratelimit.exceeded";
readingsBulkUpdate( $hash, "lastRequestState", "too many requests", 1 );
readingsBulkUpdate( $hash, "state", "inactive", 1 );
# remove all timer and disable bridge
RemoveInternalTimer( $hash );
return; # post request max.
}
else {
Log3 $dname, 5,
@ -692,8 +714,18 @@ sub ErrorHandling {
if ( !defined( $hash->{helper}{session_id} ) ) {
readingsSingleUpdate( $hash, 'token', 'none', 1 );
Log3 $name, 3,
"GardenaSmartBridge ($name) - getToken limit: "
. $hash->{helper}{gettoken_count} ;
if ($hash->{helper}{gettoken_count} < 6) {
$hash->{helper}{gettoken_count}++;
InternalTimer( gettimeofday() + 5,
"FHEM::GardenaSmartBridge::getToken", $hash );
"FHEM::GardenaSmartBridge::getToken", $hash )
} else {
RemoveInternalTimer ($hash);
$hash->{helper}{gettoken_count} = 0;
}
}
readingsEndUpdate( $dhash, 1 );
@ -1052,6 +1084,20 @@ sub WriteReadings {
if ( ref($v) eq 'ARRAY' );
#$v = encode_utf8($v);
$v = ' ' if ( !defined $v );
Log3 $name, 4,
"Gardena DEBUG DEBUG DEBUG stage 1 "
. $decode_json->{abilities}[0]{properties}[$properties]
{name}
if ( $decode_json->{abilities}[0]{properties}[$properties]
{name} !~ /ethernet_status|wifi_status/ );
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 2" . $t
if ( $decode_json->{abilities}[0]{properties}[$properties]
{name} !~ /ethernet_status|wifi_status/ );
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 3" . $v
if ( $decode_json->{abilities}[0]{properties}[$properties]
{name} !~ /ethernet_status|wifi_status/ );
readingsBulkUpdateIfChanged(
$hash,
$decode_json->{abilities}[0]{properties}[$properties]
@ -1070,35 +1116,21 @@ sub WriteReadings {
&& ref($v) eq 'HASH'
)
{
if ( $decode_json->{abilities}[0]{properties}
[$properties]{name} eq 'ethernet_status' )
{
readingsBulkUpdateIfChanged( $hash,
'ethernet_status-mac', $v->{mac} );
readingsBulkUpdateIfChanged( $hash,
'ethernet_status-ip', $v->{ip} )
if ( ref( $v->{ip} ) ne 'HASH' );
readingsBulkUpdateIfChanged( $hash,
'ethernet_status-isconnected',
$v->{isConnected} );
}
elsif ( $decode_json->{abilities}[0]{properties}
[$properties]{name} eq 'wifi_status' )
{
readingsBulkUpdateIfChanged( $hash,
'wifi_status-ssid', $v->{ssid} )
if ( ref( $v->{ssid} ) ne 'HASH' );
readingsBulkUpdateIfChanged( $hash,
'wifi_status-mac', $v->{mac} );
readingsBulkUpdateIfChanged( $hash,
'wifi_status-ip', $v->{ip} )
if ( ref( $v->{ip} ) ne 'HASH' );
readingsBulkUpdateIfChanged( $hash,
'wifi_status-isconnected', $v->{isConnected} );
readingsBulkUpdateIfChanged( $hash,
'wifi_status-signal', $v->{signal} );
}
if ( $v->{is_connected} ) {
readingsBulkUpdateIfChanged(
$hash,
$decode_json->{abilities}[0]{properties}
[$properties]{name} . '-ip',
$v->{ip}
) if ( ref( $v->{ip} ) ne 'HASH' );
readingsBulkUpdateIfChanged(
$hash,
$decode_json->{abilities}[0]{properties}
[$properties]{name} . '-isconnected',
$v->{is_connected}
) if ( $v->{is_connected} );
}
} # fi ethernet and wifi
}
$properties--;
@ -1281,7 +1313,10 @@ sub createHttpValueStrings {
my ( $hash, $payload, $deviceId, $abilities, $service_id ) = @_;
my $session_id = $hash->{helper}{session_id};
my $header = "Content-Type: application/json";
my $header = 'Content-Type: application/json';
$header .= "\r\norigin: https://smart.gardena.com";
$header .= "\r\nuser-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36";
#my $header = "Content-Type: application/json; origin: https://smart.gardena.com";
my $uri = '';
my $method = 'POST';
$header .= "\r\nAuthorization: Bearer $session_id"
@ -1328,17 +1363,16 @@ sub createHttpValueStrings {
} # park until next schedules or override
elsif (defined($abilities)
&& defined($payload)
&& $abilities eq 'mower_timer' )
&& $abilities eq 'mower' )
{
my $valve_id;
$method = 'PUT';
$uri .=
'/devices/'
. $deviceId
. '/abilities/'
. $abilities
. '/properties/mower_timer';
. '/commands/manual_start';
}
elsif (defined($abilities)
@ -1489,7 +1523,7 @@ sub DeletePassword {
<ul>
<li>debugJSON - </li>
<li>disable - Disables the Bridge</li>
<li>interval - Interval in seconds (Default=60)</li>
<li>interval - Interval in seconds (Default=180)</li>
<li>gardenaAccountEmail - Email Adresse which was used in the GardenaAPP</li>
</ul>
</ul>
@ -1550,7 +1584,7 @@ sub DeletePassword {
<ul>
<li>debugJSON - JSON Fehlermeldungen</li>
<li>disable - Schaltet die Datenübertragung der Bridge ab</li>
<li>interval - Abfrageinterval in Sekunden (default: 60)</li>
<li>interval - Abfrageinterval in Sekunden (default: 180)</li>
<li>gardenaAccountEmail - Email Adresse, die auch in der GardenaApp verwendet wurde</li>
</ul>
</ul>
@ -1574,7 +1608,7 @@ sub DeletePassword {
],
"release_status": "stable",
"license": "GPL_2",
"version": "v2.5.2",
"version": "v2.6.3",
"author": [
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
],

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,2 @@
UPD 2022-07-21_19:43:48 49634 FHEM/73_GardenaSmartBridge.pm
UPD 2022-08-11_14:24:26 107803 FHEM/74_GardenaSmartDevice.pm
UPD 2024-05-22_18:46:22 51262 FHEM/73_GardenaSmartBridge.pm
UPD 2024-05-21_09:01:54 127762 FHEM/74_GardenaSmartDevice.pm

36
hooks/commit-msg Executable file
View File

@ -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!"

18
hooks/post-commit Executable file
View File

@ -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