This commit is contained in:
Sebastian 2021-05-29 22:18:05 +02:00
parent 580f09d6db
commit 1c975f5bdc
2 changed files with 7 additions and 8 deletions

View File

@ -1,2 +1,2 @@
UPD 2021-05-29_22:04:49 5190 FHEM/73_HailoLibero.pm
UPD 2021-05-29_22:10:49 11310 lib/FHEM/Hailo/Libero.pm
UPD 2021-05-29_22:17:56 11273 lib/FHEM/Hailo/Libero.pm

View File

@ -236,7 +236,7 @@ sub Set {
getSettings($hash);
}
# open door
write($hash,undef)
write($hash,'open')
if (lc $cmd eq 'open');
}
@ -284,10 +284,10 @@ sub setSettings {
sub getSettings {
my $hash = shift;
my $name = $hash->{NAME};
Write( $hash, undef, undef, undef );
}
sub Write {
my ( $hash, $payload ) = @_;
my $name = $hash->{NAME};
@ -366,14 +366,13 @@ sub createHttpValueStrings {
if (ReadingsVal( $name, 'cookie', 'none' ) ne 'none');
my $uri = '';
my $method = 'POST';
$payload = '{}' if ( !defined($payload) );
if ( ReadingsVal( $name, 'cookie', 'none' ) eq 'none' ){
$uri .= '/login';
readingsSingleUpdate( $hash, 'state', 'fetch cookie', 1 );
} elsif ( defined($payload)){
} elsif ( $payload ne 'open'){
$uri .= '/settings';
} elsif ( $payload eq '{}'){
} elsif ( $payload eq 'open'){
$uri .= '/open';
}else {
$uri .= '/admin';