44_ROLLO.pm: Fixed an issue with external driving (when already at position)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@18436 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
KernSani 2019-01-27 20:46:04 +00:00
parent 7edd95c77c
commit e8e1dfd94e

View File

@ -26,6 +26,7 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# CHANGELOG: # CHANGELOG:
# 1.405: Fixed an issue with external driving (when already at position)
# 1.404: Hint in Commandref regarding position->pct # 1.404: Hint in Commandref regarding position->pct
# 1.403: Loglevel from 3 to 5 for few messages # 1.403: Loglevel from 3 to 5 for few messages
# Rollo should only drive 10 steps in "force" mode for up/down # Rollo should only drive 10 steps in "force" mode for up/down
@ -541,7 +542,12 @@ sub ROLLO_Start($) {
if ( $time > 0 ) { if ( $time > 0 ) {
ROLLO_Drive( $hash, $time, $direction, $command ); ROLLO_Drive( $hash, $time, $direction, $command );
} }
# Wenn drivetype "extern" müssen wir drive_type wieder zurücksetzen - KernSani 27.01.2019
elsif ( ReadingsVal( $name, "drive-type", "undef" ) eq "extern" ) {
readingsSingleUpdate( $hash, "drive-type", "na", 1 );
}
return undef; return undef;
} }
@ -612,15 +618,14 @@ sub ROLLO_Stop($) {
my %rhash = reverse %pcts; my %rhash = reverse %pcts;
if ( defined( $rhash{$newpos} ) ) { if ( defined( $rhash{$newpos} ) ) {
#ich kenne keinen Text für die pct, also als pct-nn anzeigen
$state = $rhash{$newpos}; $state = $rhash{$newpos};
} }
else { else {
#ich kenne keinen Text für die pct, also als pct-nn anzeigen
$newpos = 100 - $newpos if ( AttrVal( $name, "rl_type", "normal" ) eq "HomeKit" ); $newpos = 100 - $newpos if ( AttrVal( $name, "rl_type", "normal" ) eq "HomeKit" );
$state = "pct-$newpos"; $state = "pct-$newpos";
} }
Log3 $name, 4, "ROLLO ($name) updating state to $state";
readingsSingleUpdate( $hash, "state", $state, 1 ); readingsSingleUpdate( $hash, "state", $state, 1 );
} }