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 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() 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, +}