Supertile Label Bug

@josh I found a bug in the Supertile with labels.

If I have a label with a string of numbers starting with 0 it omits the 0. In my example 06.

No 0

However if it’s a 0 before a word like 0This it shows.

There’s some implicit parsing that occurs in the Super Tile items, so that makes sense to me that it’s being parsed as a number.

I’ll see if we can split this up a bit so the parsing doesn’t get applied to label items so they’re treated more like raw input. :slight_smile:

1 Like

We pushed an update to beta which bypasses the implicit conversions on labels and displays their raw value.

It appears to affect variables as well.

Variables have implicit conversions along with a setting within the Super Tile editor to choose how many decimals are displayed.

I checked that out. When I selected the decimal check box it switched to 5.0. I’m still looking for 05 to be displayed.

Things and Variables have implicit conversion as part of the design. The leading zeros in a value for a Thing attribute or a Variable will be ‘dropped’ if the rest of the value can be implicitly converted to a number. If a value is not implicitly convertible to a number, it will stay as the raw string value.

Okay so that makes all sense but that doesn’t solve my problem of trying to find out how to have a 05 displayed.

Can you clarify your broader use case? It looks like you’re trying to display something in a clock style format.

That’s is correct I am building a flip clock Supertile. So displaying 07:09 is going to be a bit of a challenge if I can’t have a leading 0

Can you provide a bit more context? What does the 07:09 indicate?

It would 07:00 → 7:00am.

Since I’m using a 24hr time. I prefer to us the 07 as we referred to it in the military as in 0700 hours (zero seven hundred)

@josh so other than having to resort to using a img to represent the numbers starting with 0. Is there a work around you might know or might this be addressed in a update?

It’s still not clear to me what the use-case is. I understand that 07 indicates the 07:00 hour and this whole thing is in the context of a clock. When I asked for more context, I was trying to get clarification on what the broader use-case is so I could better understand what you’re trying to accomplish to see if there are other approaches I could suggest.

Well I don’t know exactly another use case, I know your trying to understand or find a reason to justify a change. However to me if I select string as my variable type it shouldn’t be converted to a number. It should be whatever I assigned to that variable. I’m not fluent in many programing languages but the ones I am a string is a string regardless of what the content is.

I’m sorry but it’s frustrating to assign a string variable to 0123456789 and it deciding for me that I can not have 0 starting in a string.

To me my understanding of a string is a sequence of characters.

Sorry to hear that you’re feeling frustrated. :grimacing:

I’m just trying to get more details on what you are building. I understand it’s a clock, but what I don’t understand is why or what for? What time does the clock represent? Why are you setting that clock? Why break it out into separate hours and minutes rather than a “hh:mm” format - is that purely presentation or is it part of the actual logic used in a rule or somewhere else?

In other words, can you share more details about what the project is?

My goal here isn’t to determine why or why-not to make a change… I was trying to determine what other approaches I might be able to suggest to help you accomplish your goal.

The main reason why I used a separate hour and minutes variable is for better placement on top of the background. Using something like “02 45” doesn’t allow me to get the font size I’m hoping for and the spacing between the hour and the minutes. The main reason why I’m making the clock is so it fits better within my dashboard theme.

1 Like

I’ve pushed an update to beta to drop the implicit conversion from Text Variables in Super Tiles.

If I understand correctly, it sounds like you’re trying to recreate a ticking clock - are you updating the variables every minute?

It sounds like a feature request to allow custom formats in the ‘Date/Time’ Super Tile item would help you accomplish your goal?

Yes it’s a fully functioning clock it a take off of the old HTC sense flip clock.

And the variable updates? :point_up_2: