diff --git a/fhem/CHANGED b/fhem/CHANGED index d0138bd34..acdd28d96 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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. + - feature: 98_Hyperion: add set active/inactive - bugfix: 22_HOMEMODE: fix zero devider in HOMEMODE_ContactOpenCheck fix trigger alarm only if alarm triggers have changed - bugfix: 49_SSCam: fix version numbering diff --git a/fhem/FHEM/98_Hyperion.pm b/fhem/FHEM/98_Hyperion.pm index e3dffc259..1b2c22aed 100644 --- a/fhem/FHEM/98_Hyperion.pm +++ b/fhem/FHEM/98_Hyperion.pm @@ -21,17 +21,19 @@ use Blocking; my %Hyperion_sets = ( + "active" => "noArg", "addEffect" => "textField", + "clear" => "textField", + "clearall" => "noArg", "dim" => "slider,0,1,100", "dimDown" => "textField", "dimUp" => "textField", - "clear" => "textField", - "clearall" => "noArg", + "inactive" => "noArg", "mode" => "clearall,effect,off,rgb", "off" => "noArg", "on" => "noArg", - "reopen" => "noArg", "rgb" => "colorpicker,RGB", + "reopen" => "noArg", "toggle" => "noArg", "toggleMode" => "noArg", "valueGainDown" => "textField", @@ -575,7 +577,7 @@ sub Hyperion_Set($@) { my ($hash,$name,@aa) = @_; my ($cmd,@args) = @aa; - return if (IsDisabled($name) && $cmd ne "?"); + return if (IsDisabled($name) && $cmd !~ /^(active|\?)$/); my $value = (defined($args[0])) ? $args[0] : undef; return "\"set $name\" needs at least one argument and maximum five arguments" if (@aa < 1 || @aa > 5); my $duration = defined $args[1] ? int $args[1] : AttrNum($name,"hyperionDefaultDuration",0); @@ -886,6 +888,20 @@ sub Hyperion_Set($@) Hyperion_OpenDev($hash); return; } + elsif ($cmd eq "active") + { + readingsSingleUpdate($hash,"state","active",1); + Hyperion_OpenDev($hash); + return; + } + elsif ($cmd eq "inactive") + { + BlockingKill($hash->{helper}{RUNNING_PID}) if ($hash->{helper}{RUNNING_PID}); + RemoveInternalTimer($hash); + DevIo_Disconnected($hash); + readingsSingleUpdate($hash,"state","inactive",1); + return; + } if (keys %obj) { Log3 $name,5,"$name: $cmd obj json: ".encode_json(\%obj); @@ -1001,6 +1017,7 @@ sub Hyperion_Attr(@) BlockingKill($hash->{helper}{RUNNING_PID}) if ($hash->{helper}{RUNNING_PID}); RemoveInternalTimer($hash); DevIo_Disconnected($hash); + readingsSingleUpdate($hash,"state","disabled",1); } else { @@ -1099,6 +1116,10 @@ sub Hyperion_devStateIcon($;$)

set <required> [optional]