36_Shelly.pm: Bugfix roller mode

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@19923 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
phenning 2019-07-30 19:20:35 +00:00
parent 9e6c7096f5
commit 9d1c68a09f

View File

@ -39,7 +39,7 @@ use vars qw{%attr %defs};
sub Log($$);
#-- globals on start
my $version = "2.04";
my $version = "2.05";
#-- these we may get on request
my %gets = (
@ -585,7 +585,7 @@ sub Shelly_Set ($@) {
$max = 20;
}
$time = int(abs($targetpct-$pct)/100*$max);
$cmd = "?go=to_pos&roller_pos=".$targetpct;
$cmd = "?go=to_pos&roller_pos=" . ($pctnormal ? $targetpct : 100 - $targetpct);
$hash->{MOVING} = $pctnormal ? (($targetpct > $pct) ? "moving_up" : "moving_down") : (($targetpct > $pct) ? "moving_down" : "moving_up");
$hash->{DURATION} = $time;