Fixed crash when value was int instead of float

This commit is contained in:
thmichel
2025-10-16 13:34:39 +02:00
parent b34291e41f
commit 4348c899ae
3 changed files with 9 additions and 3 deletions

View File

@@ -65,7 +65,7 @@ class HomeAssistantNumericFactory extends WatchUi.PickerFactory {
public function getDrawable(index as Number, selected as Boolean) as Drawable? {
var value = getValue(index);
var text = "No item";
if (value instanceof Float) {
if (value instanceof Lang.Float) {
text = value.format(mFormatString);
}
return new WatchUi.Text({:text=>text, :color=>Graphics.COLOR_WHITE,