patch-connect_problems #35

Merged
sebastianschwarz merged 18 commits from patch-connect_problems into devel 2021-06-28 16:39:22 +00:00
2 changed files with 22 additions and 25 deletions
Showing only changes of commit 65f031e1c2 - Show all commits

View File

@ -235,11 +235,10 @@ sub Define {
my $name = shift @$aArg;
$hash->{BRIDGE} = 1;
$hash->{URL} = 'https://bff-api.sg.dss.husqvarnagroup.net/api/v1';
# $hash->{URL} =
# AttrVal( $name, 'gardenaBaseURL',
# 'https://smart.gardena.com' )
# . '/v1';
$hash->{URL} =
AttrVal( $name, 'gardenaBaseURL',
'https://smart.gardena.com' )
. '/v1';
$hash->{VERSION} = version->parse($VERSION)->normal;
$hash->{INTERVAL} = 60;
$hash->{NOTIFYDEV} = "global,$name";
@ -384,21 +383,21 @@ sub Notify {
&& $init_done
);
# if (
# $devtype eq 'GardenaSmartBridge'
# && (
# grep /^state:.Connected$/,
# @{$events} or grep /^lastRequestState:.request_error$/,
# @{$events}
# )
# )
# {
if (
$devtype eq 'GardenaSmartBridge'
&& (
grep /^state:.Connected$/,
@{$events} or grep /^lastRequestState:.request_error$/,
@{$events}
)
)
{
# InternalTimer( gettimeofday() + $hash->{INTERVAL},
# "FHEM::GardenaSmartBridge::getDevices", $hash );
# Log3 $name, 4,
# "GardenaSmartBridge ($name) - set internal timer function for recall getDevices sub";
# }
InternalTimer( gettimeofday() + $hash->{INTERVAL},
"FHEM::GardenaSmartBridge::getDevices", $hash );
Log3 $name, 4,
"GardenaSmartBridge ($name) - set internal timer function for recall getDevices sub";
}
return;
}
@ -1219,7 +1218,7 @@ sub createHttpValueStrings {
my $name = $hash->{NAME};
Log3 $name, 1, "[DEBUG] Teufelnchen 3: ".$payload;
if ( $payload eq '{}' ) {
$method = 'GET';
$method = 'GET' if (defined( $hash->{helper}{session_id} ) );
$payload = '';
$uri .= '/locations?locatioId=null&user_id=' . $hash->{helper}{user_id}
if ( exists( $hash->{helper}{user_id} )
@ -1233,10 +1232,8 @@ Log3 $name, 1, "[DEBUG] Teufelnchen 3: ".$payload;
}
$uri = '/devices/'.InternalVal($hash->{helper}{debug_device}, 'DEVICEID', 0 ) if ( exists ($hash->{helper}{debug_device}));
if ( !defined( $hash->{helper}{session_id} ) ){
$uri = '/auth/token';
$method = 'POST';
};
$uri = '/auth/token' if ( !defined( $hash->{helper}{session_id} ) );
if ( defined( $hash->{helper}{locations_id} ) ) {
if ( defined($abilities) && $abilities =~ /.*_settings/ ) {

View File

@ -1,2 +1,2 @@
UPD 2021-06-21_20:46:14 47382 FHEM/73_GardenaSmartBridge.pm
UPD 2021-06-21_21:13:21 47283 FHEM/73_GardenaSmartBridge.pm
UPD 2021-06-09_09:52:26 55505 FHEM/74_GardenaSmartDevice.pm