mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
Little Fixes
git-svn-id: https://svn.fhem.de/fhem/trunk@626 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fcc92bd0de
commit
a981dbd3db
@ -1,5 +1,31 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
##############################################
|
##############################################
|
||||||
|
#
|
||||||
# VarDump for FHEM-Devices
|
# VarDump for FHEM-Devices
|
||||||
|
#
|
||||||
|
##############################################
|
||||||
|
#
|
||||||
|
# Copyright notice
|
||||||
|
#
|
||||||
|
# (c) 2009 - 2010
|
||||||
|
# Copyright: Axel Rieger (fhem BEI anax PUNKT info)
|
||||||
|
# All rights reserved
|
||||||
|
#
|
||||||
|
# This script free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# The GNU General Public License can be found at
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html.
|
||||||
|
# A copy is found in the textfile GPL.txt and important notices to the license
|
||||||
|
# from the author is found in LICENSE.txt distributed with these scripts.
|
||||||
|
#
|
||||||
|
# This script is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
##############################################
|
##############################################
|
||||||
# Installation
|
# Installation
|
||||||
# 99_dumpdef.pm ins FHEM-Verzeichis kopieren
|
# 99_dumpdef.pm ins FHEM-Verzeichis kopieren
|
||||||
@ -10,6 +36,7 @@
|
|||||||
# Aufruf: dumpdef <XXX>
|
# Aufruf: dumpdef <XXX>
|
||||||
# <MOD> = %modules
|
# <MOD> = %modules
|
||||||
# <SEL> = %selectlist
|
# <SEL> = %selectlist
|
||||||
|
# <VAL> = %value
|
||||||
# <CMD> = %cmds
|
# <CMD> = %cmds
|
||||||
# <DAT> = %data
|
# <DAT> = %data
|
||||||
##############################################
|
##############################################
|
||||||
@ -18,6 +45,12 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
use vars qw(%data);
|
||||||
|
use vars qw(%cmds);
|
||||||
|
use vars qw(%attr);
|
||||||
|
use vars qw(%defs);
|
||||||
|
use vars qw(%modules);
|
||||||
|
use vars qw(%selectlist);
|
||||||
sub Commanddumpdef($);
|
sub Commanddumpdef($);
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -34,20 +67,29 @@ dumpdef_Initialize($)
|
|||||||
sub Commanddumpdef($)
|
sub Commanddumpdef($)
|
||||||
{
|
{
|
||||||
my ($cl, $d) = @_;
|
my ($cl, $d) = @_;
|
||||||
|
# $d = $a[1];
|
||||||
return "Usage: dumpdef <DeviceName>" if(!$d);
|
return "Usage: dumpdef <DeviceName>" if(!$d);
|
||||||
my($package, $filename, $line, $subroutine) = caller(3);
|
my($package, $filename, $line, $subroutine) = caller(3);
|
||||||
my $r = "CALLER => $package: $filename LINE: $line SUB: $subroutine \n";
|
my $r = "CALLER => $package: $filename LINE: $line SUB: $subroutine \n";
|
||||||
$r .= "SUB-NAME: " .(caller(0))[3] . "\n";
|
$r .= "SUB-NAME: " .(caller(0))[3] . "\n";
|
||||||
|
$r .= "--------------------------------------------------------------------------------\n";
|
||||||
|
$Data::Dumper::Maxdepth = 4;
|
||||||
if($d eq "CMD") {$r .= Dumper(%cmds) . "\n"; return $r; }
|
if($d eq "CMD") {$r .= Dumper(%cmds) . "\n"; return $r; }
|
||||||
if($d eq "DAT") {$r .= Dumper(%data) . "\n"; return $r; }
|
if($d eq "DAT") {$r .= Dumper(%data) . "\n"; return $r; }
|
||||||
if($d eq "MOD") {$r .= Dumper(%modules) . "\n"; return $r; }
|
if($d eq "MOD") {$r .= Dumper(%modules) . "\n"; return $r; }
|
||||||
if($d eq "SEL") {$r .= Dumper(%selectlist) . "\n"; return $r; }
|
if($d eq "SEL") {$r .= Dumper(%selectlist) . "\n"; return $r; }
|
||||||
|
if($d eq "DEF") {$r .= Dumper(%defs) . "\n"; return $r; }
|
||||||
|
|
||||||
if(!defined($defs{$d})) {
|
if(!defined($defs{$d})) {
|
||||||
return "Unkown Device";}
|
return "Unkown Device";}
|
||||||
$r .= "DUMP-DEVICE: $d \n";
|
$r .= "DUMP-DEVICE: $d \n";
|
||||||
$r .= Dumper($defs{$d}) . "\n";
|
$r .= Dumper($defs{$d}) . "\n";
|
||||||
|
$r .= "--------------------------------------------------------------------------------\n";
|
||||||
$r .= "DUMP-DEVICE-ATTR \n";
|
$r .= "DUMP-DEVICE-ATTR \n";
|
||||||
$r .= Dumper($attr{$d}) . "\n";
|
$r .= Dumper($attr{$d}) . "\n";
|
||||||
|
$r .= "--------------------------------------------------------------------------------\n";
|
||||||
|
$r .= "DUMP-DEVICE-Module \n";
|
||||||
|
$r .= Dumper($modules{$defs{$d}{TYPE}}) . "\n";
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
1;
|
1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user