Closed lolodomo closed 5 years ago
Freebox provides a WebSocket API. I could rather investigate this way of communicating.
@kaikreuzer : can you please advice what current binding is the best example using WebSocket API ? I found the bosesoundtouch binding in ESH but there are apparently few others bindings in OH2.
@lolodomo Kodi uses WebSocket. You should have a look a this new ESH feature https://github.com/eclipse/smarthome/pull/6258. That could be interesting for you. But I am afraid we do not have an integration example for it yet :wink:.
Yes, https://github.com/eclipse/smarthome/pull/6258 would be my suggestion as well - the way to use it is identical to the Jetty http client, i.e. get it injected in the handler factory and then pass it on to your handler.
Wrt gson, you might even want to wait for https://github.com/eclipse/smarthome/pull/5856 as this makes the implementation independent of gson as a library.
So looks as if you'll be at the bleeding edge here ;-)
Regarding the WebSocket API, it is finally available only for one particular feature, the file upload on the freebox server, a feature that is not used by the binding. For everything else, the HTTP¨API must be used.
Done.
I have plans for switching to Jetty for HTTP requests and to Gson for Json parsing. That would imply stopping using the library freebosos-java. The idea is to be more compliant with the openHAB recommendations and to be able to define trusted certificates ( https://github.com/eclipse/smarthome/issues/6196 ).