lgtv2mqtt icon indicating copy to clipboard operation
lgtv2mqtt copied to clipboard

Use icons in Toast

Open linkasum opened this issue 6 years ago • 4 comments

Hello! I would like to know if you can send a picture of the message via toast. The module in the openhab message when inserting a message inserts its logo. Thanks in advance

linkasum avatar Mar 02 '18 14:03 linkasum

I must admit - I don't know. Is it perhaps possible to just add the html <img src="..."> tag to the message? Will try out on ocassion.

hobbyquaker avatar Mar 12 '18 19:03 hobbyquaker

I'm not a programmer, but I started looking for information and found this, maybe it will help you

https://community.openhab.org/t/connect-sdk-binding-for-lg-webos-tvs/4726/220

linkasum avatar Mar 12 '18 19:03 linkasum

just found that

    public  void showToast(String message, String iconData, String iconExtension, ResponseListener<Object> listener)
    {
        JSONObject payload = new JSONObject();

        try {
            payload.put("message", message);

            if (iconData != null)
            {
                payload.put("iconData", iconData);
                payload.put("iconExtension", iconExtension);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }

        sendToast(payload, listener);
    }

So it is possible by adding iconData and iconExtension attributes to the payload. ~~Question is how we get the image. We could send it e.g. base64 encoded via an MQTT message - or we could define an image folder in lgtv2mqtt options where files reside that can be used.~~ Will put that on my todo, nice feature, wasn't aware that this is possible :)

Edit: just read your link and saw that we can simply supply an URL where the image can be loaded. Do you have a Webserver where you can put the images or do we need to integrate a simple webserver in lgtv2mqtt?

hobbyquaker avatar Mar 12 '18 19:03 hobbyquaker

I understand what I'm talking about, but I can not help you, only if I'm a beta tester

linkasum avatar Mar 12 '18 21:03 linkasum