Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support input element (Issue #726) #755

Merged
merged 13 commits into from
Nov 16, 2024

Conversation

TAKeanice
Copy link
Contributor

@TAKeanice TAKeanice commented May 13, 2024

This adds the widget type Input

@TAKeanice TAKeanice marked this pull request as draft May 13, 2024 05:56
@TAKeanice TAKeanice force-pushed the 726-support_input_element branch 3 times, most recently from dc9c218 to 1c8abb5 Compare November 10, 2024 18:00
@TAKeanice TAKeanice marked this pull request as ready for review November 10, 2024 18:00
@TAKeanice TAKeanice force-pushed the 726-support_input_element branch from 1c8abb5 to 9b552d8 Compare November 11, 2024 02:31
Signed-off-by: Tassilo Karge <[email protected]>
@TAKeanice TAKeanice force-pushed the 726-support_input_element branch from 682353a to e2a3e0a Compare November 11, 2024 02:33
@TAKeanice
Copy link
Contributor Author

TAKeanice commented Nov 11, 2024

Date input types not working yet, because the alertview layout breaks when adding it. Also, numbers are rounded, but that could well be is due to rounding in the backend. Otherwise works like a charm.

@TAKeanice
Copy link
Contributor Author

I now added the date and time picker directly to the cell. They show strange behaviour because they often reset when changing the date though.

@TAKeanice TAKeanice force-pushed the 726-support_input_element branch 2 times, most recently from 5817fd0 to 0a70d0e Compare November 13, 2024 22:45
@timbms
Copy link
Contributor

timbms commented Nov 15, 2024

LGTM
@digitaldan : Can you please have a look.

@mherwege
Copy link

First of all, I very much appreciate you are implementing this for ios. I introduced the functionality in sitemaps and implemented it in BasicUI and the Android app. I use an Android phone and an iPad, so always wanted this available as well.
I however don’t have a clue about development for Apple, I don’t own any Apple devices but an iPad. So I am of little help in reviewing the specific development. I am willing to test if there is a test version but would need instructions how to do it.

I noticed this comment:

They show strange behaviour because they often reset when changing the date though.

Any idea why it resets? Could it be partial updated info is sent, and comes back from SSE events, and updates it again while still editing? Or is it an issue with the DatePicker?

@TAKeanice TAKeanice force-pushed the 726-support_input_element branch from 7eb6baf to 861a2b3 Compare November 15, 2024 22:58
@TAKeanice
Copy link
Contributor Author

Any idea why it resets? Could it be partial updated info is sent, and comes back from SSE events, and updates it again while still editing? Or is it an issue with the DatePicker?

I found some peace to review the issue of resetting values. Turns out, the date that I get with my particular test setup (item of type DateTime, corresponding sitemap input element with hint "Date") gives me a date formatted like "yyyy-MM-dd HH:mm:ss". I am sending an iso-formatted date so I expected the same back, and if I am sending the "yyyy-MM-dd HH:mm:ss" format it is not accepted by OpenHab... But anyway, it´s working now.

@TAKeanice
Copy link
Contributor Author

By the way, interestingly, in the OpenHab items overview the date is shown in UTC and iso-formatted:
Bildschirmfoto 2024-11-16 um 00 11 42
and in the item detail view it is formatted like I get it in the app plus in my local time (Germany):
Bildschirmfoto 2024-11-16 um 00 13 27

@TAKeanice
Copy link
Contributor Author

@mherwege for testing a feature branch on your local device you´d need a mac to compile the app, xcode, and (at least I had to do that) adapt some app group and -identifier settings to allow using your personal (unpaid) apple developer account to deploy it to your device. You could probably use all available simulators, too. Automatic upload of TestFlight versions by the developers for every feature branch would probably be too risky, since everyone could open a merge request with any content they want. Also, they would need a mac or pay for some service that provides a mac as build server to be able to compile those versions.

@TAKeanice
Copy link
Contributor Author

I got the difference now: One is the widget label value and the other one the item state. Which is the better one to use? The latter is formatted in the same way that I must use for sending events, which seems a sensible choice...

@timbms
Copy link
Contributor

timbms commented Nov 16, 2024

@TAKeanice thanks a lot for this valuable contribution. @mherwege I will make a TestFlight release available when @TAKeanice is ready

@TAKeanice
Copy link
Contributor Author

when @TAKeanice is ready

I am ;) Implemented the last change and tested it yesterday. Date changes work smooth like butter now

@timbms timbms merged commit 441b29f into openhab:develop Nov 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants