diff --git a/fhem/FHEM/30_HUEBridge.pm b/fhem/FHEM/30_HUEBridge.pm index 3571e6f06..91b36867a 100644 --- a/fhem/FHEM/30_HUEBridge.pm +++ b/fhem/FHEM/30_HUEBridge.pm @@ -730,6 +730,9 @@ HUEBridge_Autocreate($;$) $cmdret= CommandAttr(undef,"$devname group HUEGroup"); $cmdret= CommandAttr(undef,"$devname IODev $name"); + HUEDeviceSetIcon($devname); + $defs{$devname}{helper}{fromAutocreate} = 1 ; + $autocreated++; } } diff --git a/fhem/FHEM/31_HUEDevice.pm b/fhem/FHEM/31_HUEDevice.pm index 4da57396b..beb623e2d 100644 --- a/fhem/FHEM/31_HUEDevice.pm +++ b/fhem/FHEM/31_HUEDevice.pm @@ -956,15 +956,21 @@ HUEDeviceSetIcon($;$) return undef if( !$hash ); my $name = $hash->{NAME}; - return undef if( !$hash->{modelid} ); + return if( defined($attr{$name}{icon}) && !$force ); - my $model = $hueModels{$hash->{modelid}}; - return undef if( !$model ); + if( $hash->{modelid} ) { + my $model = $hueModels{$hash->{modelid}}; + return undef if( !$model ); - my $icon = $model->{icon}; - return undef if( !$icon ); + my $icon = $model->{icon}; + return undef if( !$icon ); - $attr{$name}{icon} = $icon if( $force || !defined($attr{$name}{icon}) ); + $attr{$name}{icon} = $icon; + } elsif( $hash->{class} ) { + my $class = lc( $hash->{class} ); + + $attr{$name}{icon} = "hue_room_$class"; + } } sub HUEDevice_Parse($$) diff --git a/fhem/www/images/fhemSVG/hue_room_bathroom.svg b/fhem/www/images/fhemSVG/hue_room_bathroom.svg new file mode 100644 index 000000000..5282f9151 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_bathroom.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_bedroom.svg b/fhem/www/images/fhemSVG/hue_room_bedroom.svg new file mode 100644 index 000000000..893b157c4 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_bedroom.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_carport.svg b/fhem/www/images/fhemSVG/hue_room_carport.svg new file mode 100644 index 000000000..f946bde34 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_carport.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_dining.svg b/fhem/www/images/fhemSVG/hue_room_dining.svg new file mode 100644 index 000000000..3965883d5 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_dining.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_driveway.svg b/fhem/www/images/fhemSVG/hue_room_driveway.svg new file mode 100644 index 000000000..d710d7808 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_driveway.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_frontdoor.svg b/fhem/www/images/fhemSVG/hue_room_frontdoor.svg new file mode 100644 index 000000000..aaddef60b --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_frontdoor.svg @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_garage.svg b/fhem/www/images/fhemSVG/hue_room_garage.svg new file mode 100644 index 000000000..f8abe77a9 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_garage.svg @@ -0,0 +1,10 @@ + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_garden.svg b/fhem/www/images/fhemSVG/hue_room_garden.svg new file mode 100644 index 000000000..3b40f2d99 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_garden.svg @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_gym.svg b/fhem/www/images/fhemSVG/hue_room_gym.svg new file mode 100644 index 000000000..156b3ea67 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_gym.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_hallway.svg b/fhem/www/images/fhemSVG/hue_room_hallway.svg new file mode 100644 index 000000000..8ecf4b5e4 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_hallway.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_kids_bedroom.svg b/fhem/www/images/fhemSVG/hue_room_kids_bedroom.svg new file mode 100644 index 000000000..294d54842 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_kids_bedroom.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_kitchen.svg b/fhem/www/images/fhemSVG/hue_room_kitchen.svg new file mode 100644 index 000000000..c82e46035 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_kitchen.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_living.svg b/fhem/www/images/fhemSVG/hue_room_living.svg new file mode 100644 index 000000000..9b958eb98 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_living.svg @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_nursery.svg b/fhem/www/images/fhemSVG/hue_room_nursery.svg new file mode 100644 index 000000000..c348a51b3 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_nursery.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_office.svg b/fhem/www/images/fhemSVG/hue_room_office.svg new file mode 100644 index 000000000..e5fa9e56f --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_office.svg @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_other.svg b/fhem/www/images/fhemSVG/hue_room_other.svg new file mode 100644 index 000000000..c0cf87924 --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_other.svg @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_recreation.svg b/fhem/www/images/fhemSVG/hue_room_recreation.svg new file mode 100644 index 000000000..80b84301e --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_recreation.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_terrace.svg b/fhem/www/images/fhemSVG/hue_room_terrace.svg new file mode 100644 index 000000000..f45f9cd1e --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_terrace.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/fhem/www/images/fhemSVG/hue_room_toilet.svg b/fhem/www/images/fhemSVG/hue_room_toilet.svg new file mode 100644 index 000000000..398a5055f --- /dev/null +++ b/fhem/www/images/fhemSVG/hue_room_toilet.svg @@ -0,0 +1,10 @@ + + + + + + + + +