mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
EGPM2LAN: Get commands fixed
git-svn-id: https://svn.fhem.de/fhem/trunk@12092 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
494555d5df
commit
c387f5bf91
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- change: 17_EGPM2LAN: get-commands fixed
|
||||||
- change: 93_DbRep: plausibility checks of database column character length
|
- change: 93_DbRep: plausibility checks of database column character length
|
||||||
- bugfix: 98_Hyperion: final fix for crash bug
|
- bugfix: 98_Hyperion: final fix for crash bug
|
||||||
- bugfix: 74_AMAD: fix usb-ethernet condition in the "Send Data to
|
- bugfix: 74_AMAD: fix usb-ethernet condition in the "Send Data to
|
||||||
|
@ -44,27 +44,27 @@ sub
|
|||||||
EGPM2LAN_Get($@)
|
EGPM2LAN_Get($@)
|
||||||
{
|
{
|
||||||
my ($hash, @a) = @_;
|
my ($hash, @a) = @_;
|
||||||
my $what;
|
my $getcommand;
|
||||||
|
|
||||||
return "argument is missing" if(int(@a) != 2);
|
return "argument is missing" if(int(@a) != 2);
|
||||||
|
|
||||||
$what = $a[1];
|
$getcommand = $a[1];
|
||||||
|
|
||||||
if($what =~ /^(state|lastcommand)$/)
|
if($getcommand eq "state")
|
||||||
{
|
{
|
||||||
if(defined($hash->{READINGS}{$what}))
|
if(defined($hash->{STATE})) {
|
||||||
{
|
return $hash->{STATE}; }
|
||||||
return $hash->{READINGS}{$what}{VAL};
|
}
|
||||||
}
|
elsif($getcommand eq "lastcommand")
|
||||||
else
|
{
|
||||||
{
|
if(defined($hash->{READINGS}{lastcommand}{VAL})) {
|
||||||
return "reading not found: $what";
|
return $hash->{READINGS}{lastcommand}{VAL}; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return "Unknown argument $what, choose one of state:noArg lastcommand:noArg".(exists($hash->{READINGS}{output})?" output:noArg":"");
|
return "Unknown argument $getcommand, choose one of state:noArg lastcommand:noArg".(exists($hash->{READINGS}{output})?" output:noArg":"");
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
@ -163,7 +163,7 @@ sub EGPM2LAN_Login($$) {
|
|||||||
Log $logLevel,"EGPM2LAN try to Login @".$hash->{IP};
|
Log $logLevel,"EGPM2LAN try to Login @".$hash->{IP};
|
||||||
|
|
||||||
eval{
|
eval{
|
||||||
GetFileFromURL("http://".$hash->{IP}."/login.html", 5,"pw=" . (defined($hash->{PASSWORD}) ? $hash->{PASSWORD} : ""),0 ,$logLevel);
|
GetFileFromURLQuiet("http://".$hash->{IP}."/login.html", 5,"pw=" . (defined($hash->{PASSWORD}) ? $hash->{PASSWORD} : ""),0 ,$logLevel);
|
||||||
};
|
};
|
||||||
if ($@){
|
if ($@){
|
||||||
### catch block
|
### catch block
|
||||||
@ -215,7 +215,6 @@ sub EGPM2LAN_Statusrequest($$$) {
|
|||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
my $response = GetFileFromURL("http://".$hash->{IP}."/", 5,"" , 0 ,$logLevel);
|
my $response = GetFileFromURL("http://".$hash->{IP}."/", 5,"" , 0 ,$logLevel);
|
||||||
#CustomGetFileFromURL($hash, "http://".$hash->{IP}."/", 10, "", 0, $logLevel);
|
|
||||||
#Log 1,$response;
|
#Log 1,$response;
|
||||||
if(defined($response) && $response =~ /.,.,.,./)
|
if(defined($response) && $response =~ /.,.,.,./)
|
||||||
{
|
{
|
||||||
@ -255,8 +254,8 @@ sub EGPM2LAN_Statusrequest($$$) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log 2, "EGPM2LAN: Autocreate disabled in globals section";
|
Log 2, "EGPM2LAN: Autocreate disabled in globals section";
|
||||||
$attr{$name}{autocreate} = "off";
|
$attr{$name}{autocreate} = "off";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +313,7 @@ EGPM2LAN_Define($$)
|
|||||||
if(int(@a) == 4)
|
if(int(@a) == 4)
|
||||||
{
|
{
|
||||||
$hash->{PASSWORD} = $a[3];
|
$hash->{PASSWORD} = $a[3];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$hash->{PASSWORD} = "";
|
$hash->{PASSWORD} = "";
|
||||||
@ -333,6 +332,9 @@ EGPM2LAN_Define($$)
|
|||||||
1;
|
1;
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
=item device
|
||||||
|
=item summary controls a LAN-Socket device from Gembird
|
||||||
|
=item summary_DE steuert eine LAN-Steckdosenleiste von Gembird
|
||||||
=begin html
|
=begin html
|
||||||
|
|
||||||
<a name="EGPM2LAN"></a>
|
<a name="EGPM2LAN"></a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user