diff --git a/bundles/org.openhab.ui/doc/components/oh-colorpicker-item.md b/bundles/org.openhab.ui/doc/components/oh-colorpicker-item.md
index 6ffd5e7fb9..e4256929ad 100644
--- a/bundles/org.openhab.ui/doc/components/oh-colorpicker-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-colorpicker-item.md
@@ -56,7 +56,7 @@ Display a color picker in a list
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-input-item.md b/bundles/org.openhab.ui/doc/components/oh-input-item.md
index 97e61c504c..1dd45d6da5 100644
--- a/bundles/org.openhab.ui/doc/components/oh-input-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-input-item.md
@@ -56,7 +56,7 @@ Display an input field in a list
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-label-card.md b/bundles/org.openhab.ui/doc/components/oh-label-card.md
index c948c99e06..f65b109943 100644
--- a/bundles/org.openhab.ui/doc/components/oh-label-card.md
+++ b/bundles/org.openhab.ui/doc/components/oh-label-card.md
@@ -421,7 +421,7 @@ Display the state of an item in a card
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-label-item.md b/bundles/org.openhab.ui/doc/components/oh-label-item.md
index 64514e259a..8d4c216ed8 100644
--- a/bundles/org.openhab.ui/doc/components/oh-label-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-label-item.md
@@ -67,7 +67,7 @@ Display the state of an item in a list
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-list-item.md b/bundles/org.openhab.ui/doc/components/oh-list-item.md
index fa81c11b3c..9dbdb5ca6d 100644
--- a/bundles/org.openhab.ui/doc/components/oh-list-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-list-item.md
@@ -56,7 +56,7 @@ A list item
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-plan-marker.md b/bundles/org.openhab.ui/doc/components/oh-plan-marker.md
index 468cb41757..23f35483bb 100644
--- a/bundles/org.openhab.ui/doc/components/oh-plan-marker.md
+++ b/bundles/org.openhab.ui/doc/components/oh-plan-marker.md
@@ -62,7 +62,7 @@ A marker on a floor plan
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-player-item.md b/bundles/org.openhab.ui/doc/components/oh-player-item.md
index 51409f06d3..49e0043454 100644
--- a/bundles/org.openhab.ui/doc/components/oh-player-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-player-item.md
@@ -56,7 +56,7 @@ Display player controls in a list
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-rollershutter-item.md b/bundles/org.openhab.ui/doc/components/oh-rollershutter-item.md
index 18f57d2aec..8e9bd2b67e 100644
--- a/bundles/org.openhab.ui/doc/components/oh-rollershutter-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-rollershutter-item.md
@@ -56,7 +56,7 @@ Display rollershutter controls in a list
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-slider-item.md b/bundles/org.openhab.ui/doc/components/oh-slider-item.md
index c4d9936073..362f6122cd 100644
--- a/bundles/org.openhab.ui/doc/components/oh-slider-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-slider-item.md
@@ -56,7 +56,7 @@ Display a slider control in a list
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-stepper-item.md b/bundles/org.openhab.ui/doc/components/oh-stepper-item.md
index 84741a76a5..ef9b9fac53 100644
--- a/bundles/org.openhab.ui/doc/components/oh-stepper-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-stepper-item.md
@@ -56,7 +56,7 @@ Display a stepper control in a list
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/doc/components/oh-toggle-item.md b/bundles/org.openhab.ui/doc/components/oh-toggle-item.md
index 400e685e8a..71676da9f5 100644
--- a/bundles/org.openhab.ui/doc/components/oh-toggle-item.md
+++ b/bundles/org.openhab.ui/doc/components/oh-toggle-item.md
@@ -56,7 +56,7 @@ Display a toggle switch in a list
- Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)
+ Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)
diff --git a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/plan/index.js b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/plan/index.js
index 6a21b99b4f..d4515fe168 100644
--- a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/plan/index.js
+++ b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/plan/index.js
@@ -34,7 +34,7 @@ export const OhPlanMarkerDefinition = () => new WidgetDefinition('oh-plan-marker
])
.paramGroup(pg('icon', 'Icon', 'You can customize the styles further with CSS attributes in the iconStyle
parameter (in YAML only)'), [
pt('icon', 'Icon', 'Use oh:iconName
(openHAB icon), f7:iconName
(Framework7 icon), material:iconName
(Material icon) or iconify:iconSet:iconName
(Iconify icon, requires being online if not in cache)'),
- pb('iconUseState', 'Icon depends on state', 'Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)').a(),
+ pb('iconUseState', 'Icon depends on state', 'Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)'),
pn('iconSize', 'Icon Size', 'Size of the icon in pixels (40 by default)'),
pn('iconWidth', 'Icon Width', 'Width of the icon in pixels (for openHAB icons only, 40 by default)').a(),
pn('iconHeight', 'Icon Height', 'Height of the icon in pixels (for openHAB icons only, 40 by default)').a(),
diff --git a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/standard/cards.js b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/standard/cards.js
index 2577feec1c..4f5238c432 100644
--- a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/standard/cards.js
+++ b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/standard/cards.js
@@ -28,7 +28,7 @@ export const OhLabelCardDefinition = () => new WidgetDefinition('oh-label-card',
pt('icon', 'Icon', 'Use oh:iconName
(openHAB icon), f7:iconName
(Framework7 icon), material:iconName
(Material icon) or iconify:iconSet:iconName
(Iconify icon, requires being online if not in cache)'),
pt('iconColor', 'Icon Color', 'Not applicable to openHAB icons').a(),
pn('iconSize', 'Icon Size', 'Size of the icon in px').a(),
- pb('iconUseState', 'Icon depends on state', 'Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)').a(),
+ pb('iconUseState', 'Icon depends on state', 'Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)'),
pb('vertical', 'Vertical arrangement', 'Display label below icon')
])
.paramGroup(pg('trend', 'Trend Line', 'Show a trend line in the background'), TrendParameters())
diff --git a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/standard/listitems.js b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/standard/listitems.js
index f8018236d7..5e3d434519 100644
--- a/bundles/org.openhab.ui/web/src/assets/definitions/widgets/standard/listitems.js
+++ b/bundles/org.openhab.ui/web/src/assets/definitions/widgets/standard/listitems.js
@@ -11,7 +11,7 @@ export const ListItemParameters = () => [
pt('after', 'After', 'Text to display on the opposite side of the item (set either this or a badge)').a(),
pt('icon', 'Icon', 'Use oh:iconName
(openHAB icon), f7:iconName
(Framework7 icon), material:iconName
(Material icon) or iconify:iconSet:iconName
(Iconify icon, requires being online if not in cache)'),
pt('iconColor', 'Icon Color', 'Not applicable to openHAB icons').a(),
- pb('iconUseState', 'Icon depends on state', 'Use the state of the Item to get a dynamic icon (enabled by default for all Item types except Call
, Image
& Location
) (for openHAB icons only)').a()
+ pb('iconUseState', 'Icon depends on state', 'Use the state of the Item to get a dynamic icon (enabled by default for Contact
, Dimmer
, Rollershutter
& Switch
Item types) (for openHAB icons only)')
]
// OhListItem
diff --git a/bundles/org.openhab.ui/web/src/components/widgets/standard/list/default-list-item.js b/bundles/org.openhab.ui/web/src/components/widgets/standard/list/default-list-item.js
index 538deec59c..76225e20b6 100644
--- a/bundles/org.openhab.ui/web/src/components/widgets/standard/list/default-list-item.js
+++ b/bundles/org.openhab.ui/web/src/components/widgets/standard/list/default-list-item.js
@@ -166,7 +166,9 @@ export default function itemDefaultListComponent (item, footer) {
if (!component.config.item) component.config.item = item.name
if (!component.config.title) component.config.title = item.label || item.name
if (item.category && !component.config.icon) component.config.icon = item.category
- if (item.category && component.config.iconUseState === undefined && !['Call', 'Image', 'Location'].includes(item.type)) component.config.iconUseState = true
+ // Only enable dynamic icon by default for Item types with good support for dynamic icons and "predictable" states
+ const discreteItemTypes = ['Contact', 'Dimmer', 'Rollershutter', 'Switch']
+ if (item.category && component.config.iconUseState === undefined && (discreteItemTypes.includes(item.type) || (item.type === 'Group' && discreteItemTypes.includes(item.groupType)))) component.config.iconUseState = true
if (item.label && footer && footer.contextLabelSource) {
let text = itemContextLabel(item, footer)
if (text) component.config.footer = text