29.09.2025, 12:01
It will be possible in the next version.
Create a text input widget, set display mode to Icon and enable read-only mode.
Add to Custom JS, change 123 to the relevant widget ID (ID is shown in the modal window title when editing a widget).
Create a text input widget, set display mode to Icon and enable read-only mode.
Add to Custom JS, change 123 to the relevant widget ID (ID is shown in the modal window title when editing a widget).
Code:
const widgetId = 123
Visu.on('widget-show', widgetId, ({ widget }) => {
widget.getIcon = function() {
const value = this.values.default
return `https://openweathermap.org/img/wn/${value}@2x.png`
}
})