mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 23:14:10 +00:00
74_AutomowerConnect: Common.pm, prevent DevIo from directly setting STATE, prepare automowerconnect.js for use with FTUI 2
git-svn-id: https://svn.fhem.de/fhem/trunk@27709 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
285e1ea2df
commit
8473382611
@ -1,6 +1,8 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- bugfix: 74_AutomowerConnect: Common.pm, automowerconnect.js, fix promlem
|
||||
- feature: 74_AutomowerConnect: Common.pm, prevent DevIo from directly setting
|
||||
STATE, prepare automowerconnect.js for use with FTUI 2
|
||||
- bugfix: 74_AutomowerConnect: Common.pm, automowerconnect.js, fix problem
|
||||
with empty positions array
|
||||
- feature: 74_AutomowerConnect: Common.pm, add additional API polling
|
||||
- feature: 76_SMAInverter: bugfix DC-Power
|
||||
|
@ -297,6 +297,7 @@ my $mapZonesTpl = '{
|
||||
( $hash->{LIBRARY_VERSION} ) = $cvsid =~ /\.pm (.*)Z/;
|
||||
$hash->{Host} = 'ws.openapi.husqvarna.dev';
|
||||
$hash->{Port} = '443/v1';
|
||||
$hash->{devioNoSTATE} = 1;
|
||||
|
||||
AddExtension( $name, \&GetMap, "$type/$name/map" );
|
||||
AddExtension( $name, \&GetJson, "$type/$name/json" );
|
||||
@ -567,28 +568,12 @@ sub FW_detailFn_Update {
|
||||
|
||||
}
|
||||
|
||||
# MOWING PATH OLD
|
||||
# my $posxy = '';
|
||||
|
||||
# if ( @pos > 0 ) {
|
||||
|
||||
# $posxy = int( ( $lonlo-$pos[ 0 ]{longitude} ) * $picx / $mapx ).",".int( ( $latlo-$pos[ 0 ]{latitude} ) * $picy / $mapy ).",'".$pos[ 0 ]{act}."'";
|
||||
|
||||
# for ( my $i = 1; $i < @pos; $i++ ){
|
||||
|
||||
# $posxy .= ",".int( ( $lonlo - $pos[ $i ]{longitude} ) * $picx / $mapx ).",".int( ( $latlo - $pos[ $i ]{latitude} ) * $picy / $mapy ).",'".$pos[ $i ]{act}."'";
|
||||
|
||||
# }
|
||||
|
||||
# }
|
||||
|
||||
# ERROR MESSAGE
|
||||
my $errdesc = $hash->{helper}{lasterror}{errordesc};
|
||||
my $errdate = $hash->{helper}{lasterror}{errordate};
|
||||
my $errstate = $hash->{helper}{lasterror}{errorstate};
|
||||
|
||||
# ERROR PATH
|
||||
|
||||
my @poserrxy = ( int( ( $lonru-$lonlo ) / 2 * $picx / $mapx ), int( ( $latlo - $latru ) / 2 * $picy / $mapy ) );
|
||||
|
||||
if ( @poserr > 0 ) {
|
||||
@ -602,25 +587,6 @@ sub FW_detailFn_Update {
|
||||
|
||||
}
|
||||
|
||||
# ERROR PATH OLD
|
||||
# my $poserrxy = int( ( $lonru-$lonlo ) / 2 * $picx / $mapx ).",".int( ( $latlo - $latru ) / 2 * $picy / $mapy );;
|
||||
|
||||
# if ( @poserr > 0 ) {
|
||||
|
||||
# $poserrxy = int( ( $lonlo - $poserr[ 0 ]{longitude} ) * $picx / $mapx ) . "," . int( ( $latlo - $poserr[ 0 ]{latitude} ) * $picy / $mapy );
|
||||
|
||||
# for ( my $i = 1; $i < @poserr; $i++ ){
|
||||
# $poserrxy .= ",".int( ( $lonlo - $poserr[ $i ]{longitude} ) * $picx / $mapx) . "," . int( ( $latlo - $poserr[ $i ]{latitude} ) * $picy / $mapy );
|
||||
# }
|
||||
|
||||
# }
|
||||
|
||||
# Log3 $name, 1, "AutomowerConnectUpdateDetail ( '$name', '$type', $detailFnFirst, $picx, $picy, $scalx, [ '$errdesc', '$errdate' ], [ $posxy ], [ $poserrxy ] )";
|
||||
|
||||
# map {
|
||||
# ::FW_directNotify("#FHEMWEB:$_", "AutomowerConnectUpdateDetail ( '$name', '$type', $detailFnFirst, $picx, $picy, $scalx, [ '$errdesc', '$errdate', '$errstate' ], [ $posxy ], [ $poserrxy ] )","");
|
||||
# } devspec2array("TYPE=FHEMWEB");
|
||||
|
||||
# prepare hash for json map update
|
||||
$hash->{helper}{mapupdate}{name} = $name;
|
||||
$hash->{helper}{mapupdate}{type} = $type;
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
FW_version["automowerconnect.js"] = "$Id$";
|
||||
if ( !(typeof FW_version === 'undefined') )
|
||||
FW_version["automowerconnect.js"] = "$Id$";
|
||||
|
||||
function AutomowerConnectShowError( ctx, div, dev, picx, picy, errdesc, erray ) {
|
||||
// ERROR BANNER
|
||||
@ -274,7 +275,7 @@ function AutomowerConnectTor ( x0, y0, x1, y1 ) {
|
||||
|
||||
function AutomowerConnectUpdateJson ( path ) {
|
||||
$.getJSON( path, function( data, textStatus ) {
|
||||
log( 'AutomowerConnectUpdateJson ( '+path+' ): status '+textStatus );
|
||||
console.log( 'AutomowerConnectUpdateJson ( \''+path+'\' ): status '+textStatus );
|
||||
if ( textStatus == 'success')
|
||||
AutomowerConnectUpdateDetail ( data.name, data.type, data.detailfnfirst, data.picx, data.picy, data.scalx, data.errdesc, data.posxy, data.poserrxy );
|
||||
|
||||
@ -366,7 +367,7 @@ function AutomowerConnectUpdateDetail (dev, type, detailfnfirst, picx, picy, sca
|
||||
|
||||
} else {
|
||||
setTimeout(()=>{
|
||||
log('AutomowerConnectUpdateDetail loop: div && canvas && canvas_0 false '+ type+' '+dev );
|
||||
console.log('AutomowerConnectUpdateDetail loop: div && canvas && canvas_0 false '+ type+' '+dev );
|
||||
AutomowerConnectUpdateDetail (dev, type, detailfnfirst, picx, picy, scalx, errdesc, pos, erray);
|
||||
}, 100);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user