Merge pull request 'docs: change copyright year' (#102) from patch-merge into dev
Reviewed-on: #102
This commit is contained in:
commit
80147631d6
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Developed with VSCodium and richterger perl plugin.
|
# 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
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to comitters:
|
# Special thanks goes to comitters:
|
||||||
@ -75,9 +75,9 @@ eval { use IO::Socket::SSL; 1 }
|
|||||||
# try to use JSON::MaybeXS wrapper
|
# try to use JSON::MaybeXS wrapper
|
||||||
# for chance of better performance + open code
|
# for chance of better performance + open code
|
||||||
eval {
|
eval {
|
||||||
require JSON::MaybeXS;
|
require JSON::MaybeXS;
|
||||||
import JSON::MaybeXS qw( decode_json encode_json );
|
import JSON::MaybeXS qw( decode_json encode_json );
|
||||||
1;
|
1;
|
||||||
} or do {
|
} or do {
|
||||||
|
|
||||||
# try to use JSON wrapper
|
# try to use JSON wrapper
|
||||||
@ -629,31 +629,32 @@ sub ErrorHandling {
|
|||||||
if ($decode_json) {
|
if ($decode_json) {
|
||||||
if ( ref( $decode_json->{errors} ) eq "ARRAY"
|
if ( ref( $decode_json->{errors} ) eq "ARRAY"
|
||||||
&& exists( $decode_json->{errors} ) )
|
&& exists( $decode_json->{errors} ) )
|
||||||
# replace defined with exists
|
|
||||||
# && defined( $decode_json->{errors} ) )
|
# replace defined with exists
|
||||||
|
# && defined( $decode_json->{errors} ) )
|
||||||
{
|
{
|
||||||
# $decode_json->{errors} -> ARRAY
|
# $decode_json->{errors} -> ARRAY
|
||||||
# $decode_json->{errors}[0] -> HASH
|
# $decode_json->{errors}[0] -> HASH
|
||||||
if (exists ($decode_json->{errors}[0]{error}) ) {
|
if ( exists( $decode_json->{errors}[0]{error} ) ) {
|
||||||
readingsBulkUpdate(
|
readingsBulkUpdate(
|
||||||
$dhash,
|
$dhash,
|
||||||
"state",
|
"state",
|
||||||
$decode_json->{errors}[0]{error} . ' '
|
$decode_json->{errors}[0]{error} . ' '
|
||||||
. $decode_json->{errors}[0]{attribute},
|
. $decode_json->{errors}[0]{attribute},
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
readingsBulkUpdate(
|
readingsBulkUpdate(
|
||||||
$dhash,
|
$dhash,
|
||||||
"lastRequestState",
|
"lastRequestState",
|
||||||
$decode_json->{errors}[0]{error} . ' '
|
$decode_json->{errors}[0]{error} . ' '
|
||||||
. $decode_json->{errors}[0]{attribute},
|
. $decode_json->{errors}[0]{attribute},
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
Log3 $dname, 5,
|
Log3 $dname, 5,
|
||||||
"GardenaSmartBridge ($dname) - RequestERROR: "
|
"GardenaSmartBridge ($dname) - RequestERROR: "
|
||||||
. $decode_json->{errors}[0]{error} . " "
|
. $decode_json->{errors}[0]{error} . " "
|
||||||
. $decode_json->{errors}[0]{attribute};
|
. $decode_json->{errors}[0]{attribute};
|
||||||
} # fi exists error
|
} # fi exists error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1059,12 +1060,18 @@ sub WriteReadings {
|
|||||||
if ( ref($v) eq 'ARRAY' );
|
if ( ref($v) eq 'ARRAY' );
|
||||||
|
|
||||||
#$v = encode_utf8($v);
|
#$v = encode_utf8($v);
|
||||||
$v = ' ' if (!defined $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]
|
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/ );
|
{name} !~ /ethernet_status|wifi_status/ );
|
||||||
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 2".$t if ( $decode_json->{abilities}[0]{properties}[$properties]
|
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 2" . $t
|
||||||
|
if ( $decode_json->{abilities}[0]{properties}[$properties]
|
||||||
{name} !~ /ethernet_status|wifi_status/ );
|
{name} !~ /ethernet_status|wifi_status/ );
|
||||||
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 3".$v if ( $decode_json->{abilities}[0]{properties}[$properties]
|
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 3" . $v
|
||||||
|
if ( $decode_json->{abilities}[0]{properties}[$properties]
|
||||||
{name} !~ /ethernet_status|wifi_status/ );
|
{name} !~ /ethernet_status|wifi_status/ );
|
||||||
|
|
||||||
readingsBulkUpdateIfChanged(
|
readingsBulkUpdateIfChanged(
|
||||||
@ -1084,16 +1091,22 @@ sub WriteReadings {
|
|||||||
)
|
)
|
||||||
&& ref($v) eq 'HASH'
|
&& ref($v) eq 'HASH'
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if ($v->{is_connected} ) {
|
if ( $v->{is_connected} ) {
|
||||||
readingsBulkUpdateIfChanged( $hash,
|
readingsBulkUpdateIfChanged(
|
||||||
$decode_json->{abilities}[0]{properties}[$properties]{name}.'-ip', $v->{ip} )
|
$hash,
|
||||||
if ( ref( $v->{ip} ) ne 'HASH' );
|
$decode_json->{abilities}[0]{properties}
|
||||||
readingsBulkUpdateIfChanged( $hash,
|
[$properties]{name} . '-ip',
|
||||||
$decode_json->{abilities}[0]{properties}[$properties]{name}.'-isconnected', $v->{is_connected} )
|
$v->{ip}
|
||||||
if ( $v->{is_connected} );
|
) 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
|
} # fi ethernet and wifi
|
||||||
}
|
}
|
||||||
$properties--;
|
$properties--;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Developed with VSCodium and richterger perl plugin.
|
# 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
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to comitters:
|
# Special thanks goes to comitters:
|
||||||
@ -324,7 +324,8 @@ sub Set {
|
|||||||
elsif ( lc $cmd eq 'parkuntilnexttimer' ) {
|
elsif ( lc $cmd eq 'parkuntilnexttimer' ) {
|
||||||
$payload = '"name":"park_until_next_timer"';
|
$payload = '"name":"park_until_next_timer"';
|
||||||
if ( $mainboard_version > 10.30 ) {
|
if ( $mainboard_version > 10.30 ) {
|
||||||
$payload = '"mowerTimer":0,"startingPointDistance":null,"areaId":null';
|
$payload =
|
||||||
|
'"mowerTimer":0,"startingPointDistance":null,"areaId":null';
|
||||||
$abilities = 'mower';
|
$abilities = 'mower';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -339,12 +340,14 @@ sub Set {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ( lc $cmd eq 'startoverridetimer' ) {
|
elsif ( lc $cmd eq 'startoverridetimer' ) {
|
||||||
|
|
||||||
# $payload = '"name":"start_override_timer","parameters":{"duration":'
|
# $payload = '"name":"start_override_timer","parameters":{"duration":'
|
||||||
# . $aArg->[0] * 60 . '}';
|
# . $aArg->[0] * 60 . '}';
|
||||||
# if ( $mainboard_version > 10.30 ) {
|
# if ( $mainboard_version > 10.30 ) {
|
||||||
$payload = '"startingPointDistance":null,"areaId":null, "mowerTimer": '
|
$payload = '"startingPointDistance":null,"areaId":null, "mowerTimer": '
|
||||||
. $aArg->[0] * 60;
|
. $aArg->[0] * 60;
|
||||||
$abilities = 'mower';
|
$abilities = 'mower';
|
||||||
|
|
||||||
# } removed code < 10.30 api changes March 2024
|
# } removed code < 10.30 api changes March 2024
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -735,7 +738,8 @@ sub WriteReadings {
|
|||||||
. RigReadingsValue( $hash,
|
. RigReadingsValue( $hash,
|
||||||
$propertie->{value} ) # cast all data to string with ""
|
$propertie->{value} ) # cast all data to string with ""
|
||||||
)
|
)
|
||||||
if ( exists( $propertie->{value} )
|
if (
|
||||||
|
exists( $propertie->{value} )
|
||||||
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
. $propertie->{name} ne 'radio-quality'
|
. $propertie->{name} ne 'radio-quality'
|
||||||
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
@ -754,9 +758,10 @@ sub WriteReadings {
|
|||||||
. $propertie->{name} ne 'ic24-valves_connected'
|
. $propertie->{name} ne 'ic24-valves_connected'
|
||||||
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
. $propertie->{name} ne 'ic24-valves_master_config'
|
. $propertie->{name} ne 'ic24-valves_master_config'
|
||||||
&& ($decode_json->{abilities}[$abilities]{name} . '-'
|
&& ( $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
. $propertie->{name}) !~ /scheduling-timeslot_state_\d/
|
. $propertie->{name} ) !~ /scheduling-timeslot_state_\d/
|
||||||
&& ref( $propertie->{value} ) ne "HASH" );
|
&& ref( $propertie->{value} ) ne "HASH"
|
||||||
|
);
|
||||||
|
|
||||||
readingsBulkUpdateIfChanged(
|
readingsBulkUpdateIfChanged(
|
||||||
$hash,
|
$hash,
|
||||||
@ -852,14 +857,16 @@ sub WriteReadings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# decode timeslot_state_N arrays code by hhhdg
|
# decode timeslot_state_N arrays code by hhhdg
|
||||||
if ( defined( $propertie->{value} )
|
if ( defined( $propertie->{value} )
|
||||||
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
. $propertie->{name} =~ /scheduling-timeslot_state_\d/
|
. $propertie->{name} =~ /scheduling-timeslot_state_\d/
|
||||||
&& ref( $propertie->{value} ) eq "ARRAY" ) {
|
&& ref( $propertie->{value} ) eq "ARRAY" )
|
||||||
|
{
|
||||||
while ( my ( $r, $v ) = each @{ $propertie->{value} } ) {
|
while ( my ( $r, $v ) = each @{ $propertie->{value} } ) {
|
||||||
if ( ref($v) eq "HASH" ) {
|
if ( ref($v) eq "HASH" ) {
|
||||||
my $entry = $r+1;
|
my $entry = $r + 1;
|
||||||
while ( my ( $i_r, $i_v ) = each %{$v} ) {
|
while ( my ( $i_r, $i_v ) = each %{$v} ) {
|
||||||
readingsBulkUpdateIfChanged(
|
readingsBulkUpdateIfChanged(
|
||||||
$hash,
|
$hash,
|
||||||
@ -873,8 +880,8 @@ sub WriteReadings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} # fi defined
|
} # fi defined
|
||||||
# ic24 and other watering devices calc irrigation left in sec
|
# ic24 and other watering devices calc irrigation left in sec
|
||||||
readingsBulkUpdateIfChanged(
|
readingsBulkUpdateIfChanged(
|
||||||
$hash,
|
$hash,
|
||||||
$decode_json->{abilities}[$abilities]{name} . '-'
|
$decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
@ -974,9 +981,10 @@ sub WriteReadings {
|
|||||||
&& scalar(@soll) != scalar( @ist / 2 ) )
|
&& scalar(@soll) != scalar( @ist / 2 ) )
|
||||||
{
|
{
|
||||||
while ( my $old_schedule_id = shift(@ist) ) {
|
while ( my $old_schedule_id = shift(@ist) ) {
|
||||||
foreach ( keys %{ $hash->{READINGS} } ) {
|
foreach ( keys %{ $hash->{READINGS} } ) {
|
||||||
delete $hash->{READINGS}->{$_}
|
delete $hash->{READINGS}->{$_}
|
||||||
if ( $_ =~ /scheduling-schedules_event_${old_schedule_id}_.*/ );
|
if ( $_ =~
|
||||||
|
/scheduling-schedules_event_${old_schedule_id}_.*/ );
|
||||||
} # fi
|
} # fi
|
||||||
Log3 $name, 5,
|
Log3 $name, 5,
|
||||||
"[DEBUG] - $name : deletereading scheduling-schedules_event_${old_schedule_id}_.*"
|
"[DEBUG] - $name : deletereading scheduling-schedules_event_${old_schedule_id}_.*"
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
UPD 2024-04-15_09:21:58 49572 FHEM/73_GardenaSmartBridge.pm
|
UPD 2024-04-15_15:44:03 49971 FHEM/73_GardenaSmartBridge.pm
|
||||||
UPD 2024-04-15_09:37:55 127663 FHEM/74_GardenaSmartDevice.pm
|
UPD 2024-04-15_15:43:50 127762 FHEM/74_GardenaSmartDevice.pm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user