openhab / openhab-android

openHAB client for Android
https://play.google.com/store/apps/details?id=org.openhab.habdroid
Eclipse Public License 2.0
599 stars 317 forks source link

Virtual Number Items - Value is not displayed in first place #287

Closed gruenwaldt closed 6 years ago

gruenwaldt commented 7 years ago

I have to set value first, then the value is displayed. But: sometimes after scrolling the values are shuffled.

On iOS App it is working, so i think it is an issue of the App, not the server.

gruenwaldt commented 6 years ago

Hello,

while debugging the Android App, trying to find why no state is written to the UI... I have found the following:

Behavior

Setpoint item=Thermostat_SetTemperature label="Thermostat"

is sent to Android App like: Setpoint item=Thermostat_SetTemperature label="Thermostat [%.1f °C]"

But the entry Setpoint item=MyVirtualNumberItem label="Tagestemperatur" is sent to Android App like: Setpoint item=MyVirtualNumberItem label="Tagestemperatur"

So on an item from a thing, the format string is miraculously added ;) (don't know where this ist configured) On a virtual item this is not.

My Solution

Now I have extended my Sitemap to: Setpoint item=Thermostat_SetTemperature label="Thermostat [%.1f °C]" Setpoint item=MyVirtualNumberItem label="Tagestemperatur [%.1f °C]" And all Values are shown.

So maybe it's a feature?

anyway, the iPhone App shows the values without any formatting, so now, for me, the Android App is ahead. ;) But for me it was a surprising behavior. I would prefer if the app would show the value with a default formatting rather than showing nothing at all. And additionally it showed random values some time, what is the worst case for me.

Regards Michael

mueller-ma commented 6 years ago

I think the label formatting is configured in the binding itself and added to the item. Otherwise if you dont specify a format, no value should be shown. Basic ui should behaive the same.

mueller-ma commented 6 years ago

iPhone App shows the values without any formatting

I think that's the bug. Can you compare the behavior of both apps with basic ui?

gruenwaldt commented 6 years ago

Hello,

short comparison:

with formatting

in Android App everything looks ok by now android

in iOS no formatting is shown at all ios (side behaviour: the formatting with "Uhr" leads to not showing the value)

Basic UI looks quite similar to the Android App basicui

Conclusion

As mentioned above "Android App is ahead". The remaining problem in my case was that random Values were shown in the "shouldBeEmpty" fields where no formatting was set.

The field "Tür Warne nach Minuten" actually has no formatting. But I was not able to reproduce the filled with random value problem. So maybe its gone.

Regards Michael

mueller-ma commented 6 years ago

Can you open an issue in openhab/openhab.ios? Since the issues here are solved, I'll close this. Thanks for your detailed reports.