Smarteon / loxone-java

Java implementation of the Loxone™ communication protocol (Web Socket)
BSD 3-Clause "New" or "Revised" License
15 stars 10 forks source link

First draft for image download from miniserver #197

Closed TCke83 closed 1 year ago

TCke83 commented 1 year ago

@jimirocks i've quicky made a first draft for downloading (and caching) images from the miniserver, could you take a look and give me your comments?

The caching part maybe needs to be more permanent (together with the App object, if the last modified timestamp doesn't change), but that will be another change i guess.

jimirocks commented 1 year ago

Hi, thanks for another contribution, will get into that in day or two - hope you are not in a hurry ;-)

TCke83 commented 1 year ago

@jimirocks not in a hurry from my point of view. Love the time/effort you guys invested in this library so happy to contribute to make it even more complete. Give me your thought about the implementation.

jimirocks commented 1 year ago

@TCke83 Hi Tom, sorry for beeing late. Here are my thoughts on design (and I will also add few notes into the code):

  1. Because there is no way how to pair file request with file response on otherwise async websocket communication, there should be single point for getting APP (calling it APP since there is also FTP interface with lot of other files available) files from Miniserver. Therefore let's rename LoxoneIconRegistry.getIcon to LoxoneAppFiles.getFile
  2. I think this LoxoneAppFiles should be available straight through Loxone class
    • add Loxone.appFiles() method
    • the LoxoneAppFiles can take LoxoneWebSocket as constructor parameter => there will be no need for CommandRequestResponseListener (which feels weird anyway)
  3. Separate the image/file cache from the LoxoneAppFiles - similarly to TokenRepository introduce simple FileRepository interface and provide it's in memory implemntation for the beginning

Would you agree on this proposal?

jimirocks commented 1 year ago

Hi, sorry for not being able to progress on this due to other priorities. Is your proposal still relevant?

jimirocks commented 1 year ago

Closing due to inactivity