2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

AutomowerConnect(Device): switch to library use

git-svn-id: https://svn.fhem.de/fhem/trunk@27182 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Ellert 2023-02-05 16:30:17 +00:00
parent 4c626e3481
commit 18bea89870
2 changed files with 6 additions and 6 deletions

View File

@ -550,8 +550,8 @@ sub getMowerResponse {
my $storediff = $hash->{helper}{mower}{attributes}{metadata}{statusTimestamp} - $hash->{helper}{mowerold}{attributes}{metadata}{statusTimestamp};
if ($storediff) {
# ::FHEM::Devices::AMConnect::Common::AlignArray( $hash );
AlignArray( $hash );
::FHEM::Devices::AMConnect::Common::AlignArray( $hash ); #release
# AlignArray( $hash ); # developement
::FHEM::Devices::AMConnect::Common::FW_detailFn_Update ($hash) if (AttrVal($name,'showMap',1));
}

View File

@ -298,7 +298,7 @@ sub AlignArray {
my @searchposlon = ($hash->{helper}{searchpos}[0]{longitude}, $hash->{helper}{searchpos}[1]{longitude});
my @searchposlat = ($hash->{helper}{searchpos}[0]{latitude}, $hash->{helper}{searchpos}[1]{latitude});
my $maxLength = $hash->{helper}{$activity}{maxLength};
for ( $i = 0; $i < $poslen-3; $i++ ) { # 3 due to 2 alignment data sets at the end
for ( $i = 0; $i < $poslen-2; $i++ ) { # 2 due to 2 alignment data sets at the end
if ( $searchposlon[ 0 ] == $hash->{helper}{mower}{attributes}{positions}[ $i ]{longitude}
&& $searchposlat[ 0 ] == $hash->{helper}{mower}{attributes}{positions}[ $i ]{latitude}
&& $searchposlon[ 1 ] == $hash->{helper}{mower}{attributes}{positions}[ $i+1 ]{longitude}
@ -306,9 +306,9 @@ sub AlignArray {
# timediff per step
my $dt = 0;
$dt = int(($hash->{helper}{mower}{attributes}{metadata}{statusTimestamp} - $hash->{helper}{$arrayName}[0]{statusTimestamp})/$i) if ( $i && @{ $hash->{helper}{$arrayName} } );
for ($k=$i-1;$k>-1;$k--) {
}
for ($k=$i-1;$k>-1;$k--) {
if ( @{ $hash->{helper}{$arrayName} } ) {