diff --git a/fhem/CHANGED b/fhem/CHANGED index 1bd3bdec3..03ea28cc4 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,8 +1,10 @@ - SVN + - change: 30_HUEDevice: use new devStateIcon feature to show device color + in room overview - feature: added example Setup SQL and configuration for SQLite - change: modified MySQL Setup SQL to use 512 characters in EVENT column - feature: added new Javascript Frontend based on ExtJS (by Johannes) - - feature: new Modules 30_HUEDevice and 31_HUEBridge for phillips hue and + - feature: new Modules 30_HUEBridge and 31_HUEDevice for phillips hue and smartlink devices (by justme1968) - change: SYSSTAT: allow remote monitoring by ssh - change: SYSSTAT: allow less frequent updates for diskusage diff --git a/fhem/FHEM/31_HUEDevice.pm b/fhem/FHEM/31_HUEDevice.pm index 78acc0f2c..16966b85e 100644 --- a/fhem/FHEM/31_HUEDevice.pm +++ b/fhem/FHEM/31_HUEDevice.pm @@ -60,6 +60,9 @@ sub HUEDevice_Define($$) $hash->{fhem}{hue} = -1; $hash->{fhem}{sat} = -1; + + CommandAttr(undef,$name.' devStateIcon {CommandGet("","'.$name.' devStateIcon")}') if( !defined( AttrVal($hash->{NAME}, "devStateIcon", undef) ) ); + AssignIoPort($hash); if(defined($hash->{IODev}->{NAME})) { Log 3, "$name: I/O device is " . $hash->{IODev}->{NAME}; @@ -332,9 +335,20 @@ HUEDevice_Get($@) } } return $ret; + } elsif ( $cmd eq "devStateIcon" ) { + return '
'. + 'off' if( ReadingsVal($name,"state","off") eq "off" ); + + return '
'. + ''.$hash->{STATE}.'' if( AttrVal($hash->{NAME}, "model", "") eq "LWL001" ); + + return '
'; } - return "Unknown argument $cmd, choose one of rgb"; + return "Unknown argument $cmd, choose one of rgb devStateIcon"; } @@ -453,6 +467,7 @@ HUEDevice_GetUpdate($) my $percent = int( $state->{'bri'} * 100 / 254 ); if( $bri != $hash->{fhem}{bri} ) {readingsBulkUpdate($hash,"level", $percent . ' %');} + if( $bri != $hash->{fhem}{bri} ) {readingsBulkUpdate($hash,"pct", $percent);} if( $percent > 0 && $percent < 100 ) { $s = $dim_values{int($percent/7)}; @@ -566,6 +581,8 @@ HUEDevice_GetUpdate($) Get
@@ -573,6 +590,8 @@ HUEDevice_GetUpdate($)