I guess I found the issue. A previous PR introduced a regression, where Number() is called on the Item state containing a unit.
However Number('0 °C') returns NaN, instead parseFloat(0 °C) returns 0.
I have updated my PR, which now fixes both that issue and also allows sending a command to an Item when it’s state really is NaN.
I build an UI artifact, which should work with 4.1.0.M2 (I am on the latest snapshot, but since there was no core framework change, I expect it to work):
Deploy it to your addons folder, and log into the Karaf console:
I’ll give it a test in a minute. Do I need to stop the existing UI bundle before adding the new one to the addons? I have a personal rule (learned from experience) to not have two of the same bundles running?
Also this sounds promising. Before I saw your message I thought to create a stepper card when everything running. (I had deleted them). It was still a problem.
Lastly, (if I read the PR correctly) I do not really like the idea of setting an Item value in the widget to the minimum or maximum. I do not want the AC or furnace to start with an OH restart. If the previous value can’t be loaded, I would prefer NaN.
Edit: I did stop the OH4.1M2 binding first
The new one works on a running system. Same screenshot with updated jar.
For the UI bundle, I didn’t notice any issue when having two at the same time. The newly added one is not starting up as long as the older one is still active.
I think it makes no real difference, but if you want to, stop the existing one before installing the new one.
The stepper does not issue a command on its own, in fact I had invested a few hours some time ago to get rid of „ghost“ commands, which can occur in very rare cases.
With the PR, the stepper will be able to set the Item to a state when the state is NaN, it uses min or max or 0, but this only happens when you click plus or minus.
Great! If you have a GitHub account, it would be nice if you could approve or comment the PR — I am still not allowed to merge it because it is my own PR, but it’s always good for maintainers when someone else verifies a fix.