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/fhem@12092 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
35e04e140c
commit
916131b08a
1
CHANGED
1
CHANGED
@ -1,5 +1,6 @@
|
||||
# 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.
|
||||
- change: 17_EGPM2LAN: get-commands fixed
|
||||
- change: 93_DbRep: plausibility checks of database column character length
|
||||
- bugfix: 98_Hyperion: final fix for crash bug
|
||||
- bugfix: 74_AMAD: fix usb-ethernet condition in the "Send Data to
|
||||
|
@ -44,27 +44,27 @@ sub
|
||||
EGPM2LAN_Get($@)
|
||||
{
|
||||
my ($hash, @a) = @_;
|
||||
my $what;
|
||||
my $getcommand;
|
||||
|
||||
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}; }
|
||||
}
|
||||
elsif($getcommand eq "lastcommand")
|
||||
{
|
||||
return $hash->{READINGS}{$what}{VAL};
|
||||
if(defined($hash->{READINGS}{lastcommand}{VAL})) {
|
||||
return $hash->{READINGS}{lastcommand}{VAL}; }
|
||||
}
|
||||
else
|
||||
{
|
||||
return "reading not found: $what";
|
||||
}
|
||||
}
|
||||
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};
|
||||
|
||||
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 ($@){
|
||||
### catch block
|
||||
@ -215,7 +215,6 @@ sub EGPM2LAN_Statusrequest($$$) {
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
my $response = GetFileFromURL("http://".$hash->{IP}."/", 5,"" , 0 ,$logLevel);
|
||||
#CustomGetFileFromURL($hash, "http://".$hash->{IP}."/", 10, "", 0, $logLevel);
|
||||
#Log 1,$response;
|
||||
if(defined($response) && $response =~ /.,.,.,./)
|
||||
{
|
||||
@ -333,6 +332,9 @@ EGPM2LAN_Define($$)
|
||||
1;
|
||||
|
||||
=pod
|
||||
=item device
|
||||
=item summary controls a LAN-Socket device from Gembird
|
||||
=item summary_DE steuert eine LAN-Steckdosenleiste von Gembird
|
||||
=begin html
|
||||
|
||||
<a name="EGPM2LAN"></a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user