diff --git a/FHEM/30_HUEBridge.pm b/FHEM/30_HUEBridge.pm
index 0d368889e..7c78f49d3 100644
--- a/FHEM/30_HUEBridge.pm
+++ b/FHEM/30_HUEBridge.pm
@@ -21,6 +21,7 @@ sub HUEBridge_Initialize($)
#Consumer
$hash->{DefFn} = "HUEBridge_Define";
$hash->{SetFn} = "HUEBridge_Set";
+ $hash->{GetFn} = "HUEBridge_Get";
$hash->{UndefFn} = "HUEBridge_Undefine";
$hash->{AttrList}= "key loglevel:0,1,2,3,4,5";
}
@@ -132,6 +133,26 @@ HUEBridge_Set($@)
}
}
+sub
+HUEBridge_Get($@)
+{
+ my ($hash, $name, $cmd) = @_;
+
+ return "$name: get needs at least one parameter" if( !defined($cmd) );
+
+ # usage check
+ if($cmd eq 'devices') {
+ my $result = HUEBridge_Call($hash, 'lights', undef);
+ my $ret = "";
+ foreach my $key ( sort keys %$result ) {
+ $ret .= $key .": ". $result->{$key}{name} ."\n";
+ }
+ return $ret;
+ } else {
+ return "Unknown argument $cmd, choose one of devices";
+ }
+}
+
sub
HUEBridge_GetUpdate($)
{
@@ -422,6 +443,13 @@ HUEBridge_HTTP_Request($$$@)
+
+ Set
+
+ - devices
+ list the devices known to the bridge.
+
+
Set
diff --git a/FHEM/31_HUEDevice.pm b/FHEM/31_HUEDevice.pm
index d664a1d34..1f05b7fa5 100644
--- a/FHEM/31_HUEDevice.pm
+++ b/FHEM/31_HUEDevice.pm
@@ -445,7 +445,8 @@ HUEDevice_GetUpdate($)
my $ct = $state->{'ct'};
my $hue = $state->{'hue'};
my $sat = $state->{'sat'};
- my $xy = $state->{'xy'}->[0] .",". $state->{'xy'}->[1];
+ my $xy = ",";
+ $xy = $state->{'xy'}->[0] .",". $state->{'xy'}->[1] if( defined($state->{'xy'}) );
if( defined($colormode) && $colormode ne $hash->{fhem}{colormode} ) {readingsBulkUpdate($hash,"colormode",$colormode);}
if( defined($bri) && $bri != $hash->{fhem}{bri} ) {readingsBulkUpdate($hash,"bri",$bri);}
@@ -460,7 +461,7 @@ HUEDevice_GetUpdate($)
if( defined($hue) && $hue != $hash->{fhem}{hue} ) {readingsBulkUpdate($hash,"hue",$hue);}
if( defined($sat) && $sat != $hash->{fhem}{sat} ) {readingsBulkUpdate($hash,"sat",$sat);}
if( $xy eq "," ) {readingsBulkUpdate($hash,"xy","");}
- elsif( $xy != $hash->{fhem}{xy} ) {readingsBulkUpdate($hash,"xy",$xy);}
+ elsif( $xy ne $hash->{fhem}{xy} ) {readingsBulkUpdate($hash,"xy",$xy);}
my $s = '';
if( $on )