2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

30_pilight_*: fix trigger changes twice

git-svn-id: https://svn.fhem.de/fhem/trunk@8665 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
risiko79 2015-05-30 18:00:55 +00:00
parent fd207ee9f4
commit 2283bc9a87
3 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- bugfix: 30_pilight_*: restore (StateFn) - bugfix: 30_pilight_*: restore (StateFn), trigger changes twice
- feature: 30_pilight_dimmer: new attributes dimlevel_on, dimlevel_off - feature: 30_pilight_dimmer: new attributes dimlevel_on, dimlevel_off
dimmers without direct dimlevel support (switch combined with screen) dimmers without direct dimlevel support (switch combined with screen)
- bugfix: 73_km200: Bugfix for sorting and comparison method - bugfix: 73_km200: Bugfix for sorting and comparison method

View File

@ -112,9 +112,9 @@ sub pilight_dimmer_Parse($$)
if ($state eq "down") { if ($state eq "down") {
$dimlevel = $dimlevel_old - $dimlevel_step; $dimlevel = $dimlevel_old - $dimlevel_step;
$state="on"; $state="on";
if ($dimlevel < 0) { if ($dimlevel <= 0) {
$state="off"; $state="off";
$dimlevel = 0; $dimlevel= AttrVal($chash->{NAME}, "dimlevel_off",0);
} }
} }
@ -127,7 +127,7 @@ sub pilight_dimmer_Parse($$)
Log3 $chash->{NAME}, 5, "pilight_dimmer_Parse: $dimlevel_old $dimlevel"; Log3 $chash->{NAME}, 5, "pilight_dimmer_Parse: $dimlevel_old $dimlevel";
$dimlevel = int($dimlevel+0.5); $dimlevel = int($dimlevel+0.5);
Log3 $chash->{NAME}, 5, "pilight_dimmer_Parse: $dimlevel_old round $dimlevel"; Log3 $chash->{NAME}, 5, "pilight_dimmer_Parse: $dimlevel_old round $dimlevel";
readingsBulkUpdate($chash,"dimlevel",$dimlevel); readingsBulkUpdate($chash,"dimlevel",$dimlevel) if ($dimlevel_old != $dimlevel);
} }
readingsEndUpdate($chash, 1); readingsEndUpdate($chash, 1);
@ -260,7 +260,10 @@ sub pilight_dimmer_Set($$)
delete $hash->{helper}{DEV_DIMLEVEL} if ($set eq "off"); delete $hash->{helper}{DEV_DIMLEVEL} if ($set eq "off");
pilight_dimmer_Write($hash,$set,$dimlevel); pilight_dimmer_Write($hash,$set,$dimlevel);
return undef; #keinen Trigger bei Set auslösen
#Aktualisierung erfolgt in Parse
my $skipTrigger = 1;
return undef,$skipTrigger;
} }
##################################### #####################################

View File

@ -124,7 +124,10 @@ sub pilight_switch_Set($$)
my $msg = "$me,$v"; my $msg = "$me,$v";
IOWrite($hash, $msg); IOWrite($hash, $msg);
return undef; #keinen Trigger bei Set auslösen
#Aktualisierung erfolgt in Parse
my $skipTrigger = 1;
return undef,$skipTrigger;
} }