Using a icon-variable in custom widget?!

Hello together,

actually i am trying to create some custom widgets for my habpanel.

i already read the great “first steps tutorial” but now i need your help to get the item-variable runnig. i created the variable in the settings tab and i tried to get the values in the code, but in all the different ways i tried, the choosen icon is not shown.

So can you tell me, how the right code has to look like, when i want call this setting in the code?

Thanks for your help!

HI,

It should not be so complicated. in my case I added the built in switch icon in my custom widget and assign to it a custom widget as follows:

<div ng-init='onoff={"name": "OnOff", "item": config.onoffSwitch, "hidelabel": true, "hideonoff": true, "iconset": config.buttonicon_iconset,"icon": config.buttonicon,"icon_size": "64" }'>
    <widget-switch   ng-model="onoff" />
</div>

and then you give in the configuration settings page the id buttonicon

Works like a charm

Something like:

<widget-icon iconset="config.item_icon_iconset" icon="config.item_icon" size="50"></widget-icon>

should work.

thank you very much! it worked!

Hi,

is there a way to get to choose the size in a custom widget template. The above versions are hardcoded and i would like to choose the size sepratly.