diff --git a/fhem/CHANGED b/fhem/CHANGED index d0cb264a1..7e056401b 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: 30_HUEBridge, 31_HUEDevice: added get startup command - change: 55_DWD_OpenData: maintenance release (forum #83097 msg #869647) - change: mqtt2.template: change name convention + cleanup - feature: 72_FB_CALLLIST: new readings/events "count-..." implemented to diff --git a/fhem/FHEM/30_HUEBridge.pm b/fhem/FHEM/30_HUEBridge.pm index 315ea8eba..bf4210473 100644 --- a/fhem/FHEM/30_HUEBridge.pm +++ b/fhem/FHEM/30_HUEBridge.pm @@ -958,8 +958,32 @@ HUEBridge_Get($@) $ret = sprintf( "%-20s %-20s %-30s %s\n", "CREATE", "LAST USE", "NAME", "KEY" ) .$ret if( $ret ); return $ret; + } elsif($cmd eq 'startup' ) { + my $result = HUEBridge_Call($hash, undef, 'lights', undef); + return $result->{error}{description} if( $result->{error} ); + my $ret = ""; + foreach my $key ( sort {$a<=>$b} keys %{$result} ) { + my $code = $name ."-". $key; + my $fhem_name =""; + $fhem_name = $modules{HUEDevice}{defptr}{$code}->{NAME} if( defined($modules{HUEDevice}{defptr}{$code}) ); + $ret .= sprintf( "%2i: %-25s %-15s %s", $key, $result->{$key}{name}, $fhem_name ); + if( !$result->{$key}{config} || !$result->{$key}{config}{startup} ) { + $ret .= "not supported"; + } else { + $ret .= sprintf( "%s\t%s", $result->{$key}{config}{startup}{mode}, $result->{$key}{config}{startup}{configured} ); + } + $ret .= "\n"; + } + $ret = sprintf( "%2s %-25s %-15s %s\t%s\n", "ID", "NAME", "FHEM", "MODE", "CONFIGURED" ) .$ret if( $ret ); + return $ret; + } else { - return "Unknown argument $cmd, choose one of lights:noArg groups:noArg scenes:noArg rule rules:noArg sensors:noArg whitelist:noArg"; + my $list = "lights:noArg groups:noArg scenes:noArg rule rules:noArg sensors:noArg whitelist:noArg"; + if( $hash->{helper}{apiversion} && $hash->{helper}{apiversion} >= (1<<16) + (26<<8) ) { + $list .= " startup:noArg"; + } + + return "Unknown argument $cmd, choose one of $list"; } } @@ -1848,6 +1872,8 @@ HUEBridge_Attr($$$) list the groups known to the bridge.
  • scenes [detail]
    list the scenes known to the bridge.
  • +
  • startup
    + show startup behavior of all known lights
  • rule <id>
    list the rule with <id>.
  • rules [detail]
    diff --git a/fhem/FHEM/31_HUEDevice.pm b/fhem/FHEM/31_HUEDevice.pm index eb22ac7f6..e48fa37da 100644 --- a/fhem/FHEM/31_HUEDevice.pm +++ b/fhem/FHEM/31_HUEDevice.pm @@ -988,11 +988,22 @@ HUEDevice_Get($@) ($r,$g,$b) = xyYtorgb($x,$y,$Y); } return sprintf( "%02x%02x%02x", $r+0.5, $g+0.5, $b+0.5 ); + } elsif ( $cmd eq "startup" ) { + my $result = IOWrite($hash,undef,$hash->{NAME},$hash->{ID}); + return $result->{error}{description} if( $result->{error} ); + return "not supported" if( !$result->{config} || !$result->{config}{startup} ); + return "$result->{config}{startup}{mode}\t$result->{config}{startup}{configured}"; + return Dumper $result->{config}{startup}; + } elsif ( $cmd eq "devStateIcon" ) { return HUEDevice_devStateIcon($hash); } - return "Unknown argument $cmd, choose one of rgb:noArg RGB:noArg devStateIcon:noArg"; + my $list = "rgb:noArg RGB:noArg devStateIcon:noArg"; + if( $defs{$name}->{IODev}->{helper}{apiversion} && $defs{$name}->{IODev}->{helper}{apiversion} >= (1<<16) + (26<<8) ) { + $list .= " startup:noArg"; + } + return "Unknown argument $cmd, choose one of $list"; } @@ -1629,6 +1640,8 @@ HUEDevice_Attr($$$;$)