From 38926190bcb6c8a5930169d0f9d3c1ea9318ed2d Mon Sep 17 00:00:00 2001 From: Jan Wiele Date: Sun, 28 Apr 2024 20:25:51 +0200 Subject: [PATCH 1/3] README.md: add XW5000 as supported projector --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7fa100f..1b259ba 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Supported Sony projectors should include: * VPL-VW520 * VPL-VW528 * VPL-VW665 +* VPL-XW5000 From 3c4d49ee633896db566b694185aedea6c12632a3 Mon Sep 17 00:00:00 2001 From: Jan Wiele Date: Sun, 28 Apr 2024 20:26:17 +0200 Subject: [PATCH 2/3] protocol.py: add calibration presets --- pysdcp/protocol.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pysdcp/protocol.py b/pysdcp/protocol.py index cede885..5ae86c8 100644 --- a/pysdcp/protocol.py +++ b/pysdcp/protocol.py @@ -55,3 +55,15 @@ "COOLING": 4, "COOLING2": 5 } + +CALIBRATION_PRESETS = { + "CINEMA_FILM_1": 0x0000, + "CINEMA_FILM_2": 0x0001, + "REFERENCE": 0x0002, + "TV": 0x0003, + "PHOTO": 0x0004, + "GAME": 0x0005, + "BRIGHT_CINEMA": 0x0006, + "BRIGHT_TV": 0x0007, + "USER": 0x0008, +} From 6ea7ac250354a009e15fb67e15c2d9df82dfb409 Mon Sep 17 00:00:00 2001 From: Jan Wiele Date: Sun, 28 Apr 2024 20:26:59 +0200 Subject: [PATCH 3/3] __init__.py: add get/set for calibration preset --- pysdcp/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pysdcp/__init__.py b/pysdcp/__init__.py index 814dc41..893530d 100644 --- a/pysdcp/__init__.py +++ b/pysdcp/__init__.py @@ -201,7 +201,21 @@ def get_power(self): return False else: return True - + + def set_calibration_preset(self, calibration_preset: str): + if calibration_preset not in CALIBRATION_PRESETS: + raise ValueError("Calibration preset not found") + else: + self._send_command(action=ACTIONS["SET"], command=COMMANDS["CALIBRATION_PRESET"], + data=CALIBRATION_PRESETS[calibration_preset]) + return True + + def get_calibration_preset(self): + data = self._send_command(action=ACTIONS["GET"], command=COMMANDS["CALIBRATION_PRESET"]) + for key, value in CALIBRATION_PRESETS.items(): + if value == data: + return key + return "UNKNOWN_CALIBRATION_PRESET_"+str(data) if __name__ == '__main__': # b = Projector()