You can change the colors - red is probably wrong when the tank is full…
You can also reduce the “ticks” so that the “small lines” doesn’t indicate each 6.66. And for such a long title, you might want to reduce the font size a tad. If you add unit metadata to your Item, it will also show %.
Could the default “Action” be made available for this widget? So that when you click on the item, that you can define what it needs to do (such as go to the analyze page of the item)
The truth is that I don’t know if that’s possible with a widget. Have you seen any other widgets that do this? If so, let me know which, so I can see how they have done it.
The problem is, that just letting you choose the Action isn’t very useful. The different actions have different parameters, so you must somehow dynamically create/enable other parameters depending on which action has been chosen. I have some vague memory that there might be some clever way to do this, but I just cannot remember the details, or if it’s in fact true.
@JustinG Sorry to bother you again, and it might not be up your alley, but do you have any hints or knowledge about his? @rlkoshak You have also done a lot of gymnastics with the parameters, so maybe you have some hint for me about where to look?
This is a built-in feature. You don’t define a parameter, but instead a parameter group (with no other parameters assigned to it) and give that parameter group context: action. Then, on the component that should have the specified action, you don’t set any of the action properties, you just set actionPropsParameterGroup to the name of the action parameter group you just defined. All the different actions and their related inputs will be dynamically produced in the property dialog and passed on to the component.
I’m sorry, I’m quite sick and unable to test/work on anything. That said, I’m sure there are others like @JustinG that can guide you in what you need to modify to achieve that.
@dk8pn In the widget code, there are several instances where the widget expressions include:
items[props.item].state.split(' ')[1]
These are all the places where the widget extracts the unit from the item state. To simply get your custom unit just replace each of those instances with
'°min'
If you are looking to make this more flexible, you could add a new property following the same format as any of the other properties (I would recommend using one of the ones with groupName: appearance as a template). Then you would need to replace the expression above with props.NAME_OF_YOUR_PROP and then you could set the unit using the configuration properties of the widget.