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

Is it possible to control brightness? #110

Open
crixyd opened this issue Jul 9, 2022 · 1 comment
Open

Is it possible to control brightness? #110

crixyd opened this issue Jul 9, 2022 · 1 comment

Comments

@crixyd
Copy link

crixyd commented Jul 9, 2022

I own a 2022 the frame (QA65LS03BAWXXY) and am dissatisfied with the light sensor for brightness control, and was hoping to use a lux sensor and some automations to override the brightness. Unfortunately I can't find any mention of brightness controls via the WS API. Samsungctl supports brightness control in legacy mode, but it doesn't work on the frame. Is there a way to set brightness using this library that I am missing? Or perhaps a way to add support?

@danslaughter2
Copy link

I just added the following functions to samsungtvws/art.py and tested on my 55" (2019) frame (model QN55LS03RAFXZA) while in art mode and it works.

    def get_brightness(self):
        response = self._send_art_request(
            {"request": "get_brightness"},
            wait_for_event=D2D_SERVICE_MESSAGE_EVENT,
        )   
        assert response
        return json.loads(response["data"])

    def set_brightness(self, value):
        self._send_art_request(
            {   
                "request": "set_brightness",
                "value": value,
            }   
        )

You could tweak the get_brightness function to return just the brightness value but I return everything since the response also includes the min and max values for the setting which could be useful for integrating into a UI. Here's sample output from my frame.

INFO:root:{'id': 'f3695455-29be-4497-84df-f9d2fd0de44b', 'event': 'brightness', 'value': '3', 'min': '-5', 'max': '5', 'target_client_id': '4edc5c3-ebc4-4fa4-b9ab-b5abc43ff16f'}

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

2 participants