2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-27 22:53:29 +00:00

98_PID20.pm: remove smartmatch issues

git-svn-id: https://svn.fhem.de/fhem/trunk@28751 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2024-04-05 10:18:01 +00:00
parent d1b0253d17
commit e1584846b2

View File

@ -100,14 +100,11 @@ package main;
use strict;
use warnings;
no if $] >= 5.017011, warnings => 'experimental';
use feature qw/say switch/;
use vars qw(%defs);
use vars qw($readingFnAttributes);
use vars qw(%modules);
my $PID20_Version = "1.0.0.9";
my $PID20_Version = "1.0.0.10";
sub PID20_Calc($);
########################################
sub PID20_Log($$$)
@ -383,14 +380,9 @@ sub PID20_Set($@)
my $desiredName = lc( AttrVal( $name, 'pidDesiredName', 'desired' ) );
#PID20_Log $hash, 3, "name:$name cmd:$cmd $desired:$desired";
given ($cmd)
{
when ('?')
{
if ($cmd eq '?') {
return $usage;
}
when ($desiredName)
{
} elsif ($cmd eq $desiredName) {
return "Set " . AttrVal( $name, 'pidDesiredName', 'desired' ) . " needs a <value> parameter"
if ( @a != 3 );
my $value = $a[2];
@ -399,23 +391,17 @@ sub PID20_Set($@)
if ( !defined($value) );
readingsSingleUpdate( $hash, $cmd, $value, 1 );
PID20_Log $hash, 3, "set $name $cmd $a[2]";
}
when ('start')
{
} elsif ($cmd eq 'start') {
return 'Set start needs a <value> parameter'
if ( @a != 2 );
$hash->{helper}{stopped} = 0;
PID20_RestartTimer($hash,1);
}
when ('stop')
{
} elsif ($cmd eq 'stop') {
return 'Set stop needs a <value> parameter'
if ( @a != 2 );
$hash->{helper}{stopped} = 1;
PID20_RestartTimer($hash,1);
}
when ('restart')
{
} elsif ($cmd eq 'restart') {
return 'Set restart needs a <value> parameter'
if ( @a != 3 );
my $value = $a[2];
@ -428,16 +414,11 @@ sub PID20_Set($@)
$hash->{helper}{adjust} = $value;
PID20_RestartTimer($hash,1);
PID20_Log $hash, 3, "set $name $cmd $value";
}
when ("calc") # inofficial function, only for debugging purposes
{
} elsif ($cmd eq 'calc') {
PID20_Calc($name);
}
default
{
} else {
return $usage;
}
}
return;
}
########################################