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

[TODO] Add text support #100

Open
xchwarze opened this issue Mar 19, 2022 · 0 comments
Open

[TODO] Add text support #100

xchwarze opened this issue Mar 19, 2022 · 0 comments

Comments

@xchwarze
Copy link
Owner

xchwarze commented Mar 19, 2022

taken from https://github.com/roberodin/ha-samsungtv-custom/blob/master/custom_components/samsungtv_custom/samsungctl_080b/remote_websocket.py

    def _serialize_string(string):
        if isinstance(string, str):
            string = str.encode(string)

        return base64.b64encode(string).decode("utf-8")
    def input_text(self, text):
        """
        {
            "method":"ms.remote.control",
            "params":{
                "Cmd":base64.b64encode,
                "TypeOfRemote":"SendInputString",
                "DataOfCmd":"base64",
            }
        }
        """

        params = dict(
            Cmd=self._serialize_string(text),
            TypeOfRemote="SendInputString",
            DataOfCmd="base64"
        )

        self.send('ms.remote.control', **params)
@xchwarze xchwarze changed the title Add text support [TODO] Add text support May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant