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

Use icons in Toast #7

Open
linkasum opened this issue Mar 2, 2018 · 4 comments
Open

Use icons in Toast #7

linkasum opened this issue Mar 2, 2018 · 4 comments

Comments

@linkasum
Copy link

linkasum commented Mar 2, 2018

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

@hobbyquaker
Copy link
Owner

hobbyquaker commented Mar 12, 2018

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.

@linkasum
Copy link
Author

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

@hobbyquaker
Copy link
Owner

hobbyquaker commented Mar 12, 2018

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 hobbyquaker changed the title Toast Use icons in Toast Mar 12, 2018
@linkasum
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants