eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
865 stars 782 forks source link

Updating the proxy to support image item in any UI #4417

Closed lolodomo closed 7 years ago

lolodomo commented 7 years ago

I opened a request for support for image item in Android app (https://github.com/openhab/openhab.android/issues/216) 14 months ago and no one is willing to implement this feature. It might be not easy at all, I don't know.

I was the one who implemented this feature in Basic UI and Classic UI and now I am asking myself why I have not simply updated the proxy to provide image data from image items ? It would have avoided any specific code in UIs and image items would have been automatically supported by any UI already supporting image URL. This solution was probably forgiven when we discussed about implementation in Basic UI and Classic UI but I don't remember why.

Updating the proxy would I think mainly require building HTTP headers and pushing the raw data as body ?

WDYT ?

lolodomo commented 7 years ago

Using the proxy would mean an additional transfer of image data between the client UI and the openHAB server (the data is already provided through the REST API). So the current implementation in Basic UI and Classic UI consisting in not requesting the proxy in such a case is better but the solution with proxy could be interesting for other UIs that don't want to implement specifc code for image items.

lolodomo commented 7 years ago

@kaikreuzer @maggu2810 @sjka : I am waiting for your thoughts before going further.

lolodomo commented 7 years ago

We could rather implement another service/servlet that will provide image from image items. The proxy servlet would redirect to it for image tems.

lolodomo commented 7 years ago

Finally I think it would be easier to simply fix the Android app.

ptweety commented 7 years ago

And what about the iOS app? Will there also be a fix/implementation required?

lolodomo commented 7 years ago

Yes surely

maggu2810 commented 7 years ago

I don't know if I get the point. The openHAB android app (also the iOS one?) does not support image item and no one implement the image item handling in that app. Correct? There are IMHO only a few item types in ESH and the clients should support them. Adding another code just because of missing item support in client seems a little bit strange to me.

lolodomo commented 7 years ago

I agree with you.

I have now an android dev env and I should be able, I hope, to add support of image item.

lolodomo commented 7 years ago

I close the debate.

lolodomo commented 7 years ago

For information, I have now implemented support for image items in the Android app, it was only few lines of code to add. https://github.com/openhab/openhab.android/pull/414