mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-02 00:48:53 +00:00
44_ROLLO.pm: Bugfixes autostop not working and $desiredPos warning
git-svn-id: https://svn.fhem.de/fhem/trunk@18260 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f1caf321ec
commit
cf5d6d9511
@ -31,7 +31,7 @@ package main;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $version = "1.401";
|
my $version = "1.402";
|
||||||
|
|
||||||
my %sets = (
|
my %sets = (
|
||||||
"open" => "noArg",
|
"open" => "noArg",
|
||||||
@ -217,7 +217,7 @@ sub ROLLO_Set($@) {
|
|||||||
Log3 $name, 1,
|
Log3 $name, 1,
|
||||||
"ROLLO ($name) Set command \"position\" is deprecated. Please change your definitions to \"pct\"";
|
"ROLLO ($name) Set command \"position\" is deprecated. Please change your definitions to \"pct\"";
|
||||||
}
|
}
|
||||||
|
my $desiredPos;
|
||||||
my $arg = "";
|
my $arg = "";
|
||||||
$arg = $a[2] if defined $a[2];
|
$arg = $a[2] if defined $a[2];
|
||||||
my $arg2 = "";
|
my $arg2 = "";
|
||||||
@ -302,7 +302,7 @@ sub ROLLO_Set($@) {
|
|||||||
|
|
||||||
##### now do the real drive stuff
|
##### now do the real drive stuff
|
||||||
|
|
||||||
my $desiredPos = $cmd;
|
$desiredPos = $cmd;
|
||||||
Log3 $name, 5, "ROLLO ($name) DesiredPos set to $desiredPos, ($arg) ";
|
Log3 $name, 5, "ROLLO ($name) DesiredPos set to $desiredPos, ($arg) ";
|
||||||
my $typ = AttrVal( $name, "rl_type", "normal" );
|
my $typ = AttrVal( $name, "rl_type", "normal" );
|
||||||
|
|
||||||
@ -348,7 +348,10 @@ sub ROLLO_Set($@) {
|
|||||||
# Ich verstehe nicht wann nachfolgender Zustand eintreten kann, das Coding führt aber dazu, dass pct 0 (open) auf "none" gesetzt wird
|
# Ich verstehe nicht wann nachfolgender Zustand eintreten kann, das Coding führt aber dazu, dass pct 0 (open) auf "none" gesetzt wird
|
||||||
#$desiredPos = "none" if !$desiredPos || $desiredPos eq "";
|
#$desiredPos = "none" if !$desiredPos || $desiredPos eq "";
|
||||||
}
|
}
|
||||||
Log3 $name, 5, "ROLLO ($name) DesiredPos now $desiredPos, $cmd";
|
#set desiredPos to avoid "uninitialized" message later (happens with "blocked" - KernSani 14.01.2019
|
||||||
|
$desiredPos = ReadingsNum($name,"desired_pct",0) unless defined($desiredPos);
|
||||||
|
|
||||||
|
Log3 $name, 5, "ROLLO ($name) DesiredPos now $desiredPos, $cmd";
|
||||||
|
|
||||||
#wenn ich gerade am fahren bin und eine neue Zielposition angefahren werden soll,
|
#wenn ich gerade am fahren bin und eine neue Zielposition angefahren werden soll,
|
||||||
# muss ich jetzt erst mal meine aktuelle Position berechnen und updaten
|
# muss ich jetzt erst mal meine aktuelle Position berechnen und updaten
|
||||||
@ -568,7 +571,7 @@ sub ROLLO_Stop($) {
|
|||||||
Log3 $name, 4, "ROLLO ($name) stops from $state at pct $pct";
|
Log3 $name, 4, "ROLLO ($name) stops from $state at pct $pct";
|
||||||
|
|
||||||
#wenn autostop=1 und pct <> 0+100 und rollo fährt, dann kein stopbefehl ausführen...
|
#wenn autostop=1 und pct <> 0+100 und rollo fährt, dann kein stopbefehl ausführen...
|
||||||
if ( ( $state =~ /drive-/ && $pct >= 0 && $pct <= 100 ) || AttrVal( $name, "rl_autoStop", 0 ) ne 1 ) {
|
if ( ( $state =~ /drive-/ && $pct > 0 && $pct < 100 ) || AttrVal( $name, "rl_autoStop", 0 ) ne 1 ) {
|
||||||
my $command = AttrVal( $name, 'rl_commandStop', "" );
|
my $command = AttrVal( $name, 'rl_commandStop', "" );
|
||||||
$command = AttrVal( $name, 'rl_commandStopUp', "" ) if ( AttrVal( $name, 'rl_commandStopUp', "" ) ne "" );
|
$command = AttrVal( $name, 'rl_commandStopUp', "" ) if ( AttrVal( $name, 'rl_commandStopUp', "" ) ne "" );
|
||||||
$command = AttrVal( $name, 'rl_commandStopDown', "" )
|
$command = AttrVal( $name, 'rl_commandStopDown', "" )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user