fix Undefined subroutine &GardenaSmartDevice

This commit is contained in:
Marko Oldenburg 2018-10-17 21:58:50 +02:00
parent 128a4ead65
commit aef7235861
2 changed files with 5 additions and 50 deletions

View File

@ -58,28 +58,8 @@ package main;
use strict;
use warnings;
my $version = "1.2.2";
my $version = "1.4.0";
# # Declare functions
# sub Attr(@);
# sub Define($$);
# sub Initialize($);
# sub Set($@);
# sub Write($@);
# sub Undef($$);
# sub Delete($$);
# sub ResponseProcessing($$);
# sub ErrorHandling($$$);
# sub WriteReadings($$);
# sub ParseJSON($$);
# sub getDevices($);
# sub getToken($);
# sub createHttpValueStrings($@);
# sub Notify($$);
# sub StorePassword($$);
# sub ReadPassword($);
# sub DeletePassword($);
# sub Rename(@);
sub GardenaSmartBridge_Initialize($) {
@ -166,7 +146,7 @@ sub Define($$) {
my @a = split( "[ \t][ \t]*", $def );
return "too few parameters: define <NAME> GardenaSmartBridge"
if ( @a < 2 or @a > 4 );
if ( @a != 2 );
return
"Cannot define Gardena Bridge device. Perl modul ${missingModul}is missing."
if ($missingModul);
@ -181,9 +161,6 @@ sub Define($$) {
CommandAttr( undef, $name . ' room GardenaSmart' )
if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
CommandDefMod( undef, $name . ' ' . $hash->{TYPE} )
if ( @a > 2 ); # fix new define
readingsSingleUpdate( $hash, 'token', 'none', 1 );
readingsSingleUpdate( $hash, 'state', 'initialized', 1 );
@ -277,8 +254,6 @@ sub Notify($$) {
my $events = deviceEvents( $dev, 1 );
return if ( !$events );
#Log3 $name, 1, "GardenaSmartBridge ($name) - Im Notify: DEVTYPE: $devtype, DEVNAME: $devname EVENT: @{$events}";
getToken($hash)
if (
(
@ -338,8 +313,6 @@ sub Set($@) {
my ( $hash, $name, $cmd, @args ) = @_;
#my ($arg, @params) = @args;
if ( lc $cmd eq 'getdevicesstate' ) {
getDevices($hash);
@ -408,7 +381,6 @@ sub Write($@) {
}
);
#Log3 $name, 4, "GardenaSmartBridge ($name) - Send with URL: $hash->{URL}$uri, HEADER: $header, DATA: $payload, METHOD: $method";
Log3 $name, 4,
"GardenaSmartBridge ($name) - Send with URL: $hash->{URL}$uri, HEADER: secret!, DATA: secret!, METHOD: $method";
}
@ -1025,7 +997,6 @@ sub DeletePassword($) {
my $hash = shift;
#my $index = $hash->{TYPE}."_".$hash->{NAME}."_passwd";
setKeyValue( $hash->{TYPE} . "_" . $hash->{NAME} . "_passwd", undef );
return undef;

View File

@ -58,20 +58,7 @@ package main;
use strict;
use warnings;
# # Declare functions
# sub GardenaSmartDevice_Attr(@);
# sub GardenaSmartDevice_Define($$);
# sub GardenaSmartDevice_Initialize($);
# sub GardenaSmartDevice_Set($@);
# sub GardenaSmartDevice_Undef($$);
# sub GardenaSmartDevice_WriteReadings($$);
# sub GardenaSmartDevice_Parse($$);
# sub GardenaSmartDevice_ReadingLangGerman($$);
# sub GardenaSmartDevice_RigRadingsValue($$);
# sub GardenaSmartDevice_Zulu2LocalString($);
# sub GardenaSmartDevice_SetPredefinedStartPoints($@);
my $version = "1.3.0";
my $version = "1.4.0";
sub GardenaSmartDevice_Initialize($) {
@ -129,7 +116,8 @@ BEGIN {
AssignIoPort
modules
IOWrite
defs)
defs
makeDeviceName)
);
}
@ -179,11 +167,9 @@ sub Define($$) {
and $d->{IODev} == $hash->{IODev}
and $d->{NAME} ne $name );
#$attr{$name}{room} = "GardenaSmart" if( not defined( $attr{$name}{room} ) );
CommandAttr( undef, $name . ' room GardenaSmart' )
if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
#$attr{$name}{model} = $category if( not defined( $attr{$name}{model} ) );
CommandAttr( undef, $name . ' model ' . $category )
if ( AttrVal( $name, 'model', 'none' ) eq 'none' );
@ -219,8 +205,6 @@ sub Set($@) {
my ( $hash, $name, $cmd, @args ) = @_;
#my ($arg, @params) = @args;
my $payload;
my $abilities = '';