mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 13:24:56 +00:00
HMCCU: bug fixes and formatting of STATE
git-svn-id: https://svn.fhem.de/fhem/trunk@10191 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c62679e38d
commit
65564f7c4d
@ -128,6 +128,7 @@ sub HMCCU_SetVariable ($$$);
|
|||||||
sub HMCCU_GetChannel ($$);
|
sub HMCCU_GetChannel ($$);
|
||||||
sub HMCCU_RPCGetConfig ($$$);
|
sub HMCCU_RPCGetConfig ($$$);
|
||||||
sub HMCCU_RPCSetConfig ($$$);
|
sub HMCCU_RPCSetConfig ($$$);
|
||||||
|
sub HMCCU_State ($);
|
||||||
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -1007,7 +1008,7 @@ sub HMCCU_CheckProcess ($)
|
|||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
my $pdump = `ps -ef | grep ccurpcd | grep -v grep`;
|
my $pdump = `ps -ef | grep ccurpcd\.pl | grep -v grep`;
|
||||||
my @plist = split "\n", $pdump;
|
my @plist = split "\n", $pdump;
|
||||||
|
|
||||||
foreach my $proc (@plist) {
|
foreach my $proc (@plist) {
|
||||||
@ -1837,6 +1838,33 @@ sub HMCCU_RPCSetConfig ($$$)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
####################################################
|
||||||
|
# Return string for internal STATE. This function
|
||||||
|
# can be used in attribute stateFormat.
|
||||||
|
####################################################
|
||||||
|
|
||||||
|
sub HMCCU_State ($)
|
||||||
|
{
|
||||||
|
my ($name) = @_;
|
||||||
|
|
||||||
|
my $hash = $defs{$name};
|
||||||
|
my $sf = AttrVal ($name, 'ccustate', '');
|
||||||
|
|
||||||
|
return ReadingsVal ($name, 'state', '') if ($sf eq '');
|
||||||
|
|
||||||
|
my $st = $sf;
|
||||||
|
my $r = $hash->{READINGS};
|
||||||
|
|
||||||
|
if ($r->{state}{VAL} ne "Error") {
|
||||||
|
$st =~ s/\b([A-Za-z\d_\.\:-]+)\b/($r->{$1} ? $r->{$1}{VAL} : $1)/ge;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$st = "Error";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $st;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user