From b57eed6dbd8b3ede65365ec79163742fcb925a0f Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 23 Aug 2023 21:22:29 +0800 Subject: [PATCH] added brightness --- world_clock2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/world_clock2.py b/world_clock2.py index 9a19ddb..c6035ef 100644 --- a/world_clock2.py +++ b/world_clock2.py @@ -8,7 +8,7 @@ try: with open('clock_screensaver.json', 'r') as f: settings = json.load(f)['world_clock'] except: - settings1 = {"clock1": {"time_color": "White", "weekday_color": "Cyan", "date_color": "Blue", "timezone": "Etc/GMT+4", "display_seconds": True, "display_pm": True, "12hour": True}, "clock2": {"time_color": "Orange", "date_color": "White", "timezone": "Etc/GMT+4", "display_seconds": True, "display_pm": True, "12hour": True}, "world_clock": {"city_color": "White", "display_seconds": True, "display_pm": True, "12hour": True}} + settings1 = {"clock1": {"time_color": "White", "weekday_color": "Cyan", "date_color": "Blue", "timezone": "Etc/GMT+4", "display_seconds": True, "display_pm": True, "12hour": True, "brightness": "10"}, "clock2": {"time_color": "Orange", "date_color": "White", "timezone": "Etc/GMT+4", "display_seconds": True, "display_pm": True, "12hour": True, "brightness": "10"}, "world_clock": {"city_color": "White", "display_seconds": True, "display_pm": True, "12hour": True, "brightness": "10"}} with open('clock_screensaver.json', 'w') as f: json.dump(settings1, f) settings = settings1['world_clock'] @@ -20,6 +20,7 @@ options.chain_length = 1 options.parallel = 1 options.hardware_mapping = 'adafruit-hat' # Change this if you have a different GPIO mapping options.gpio_slowdown = 2 +options.brightness = int(settings['brightness'])*10 matrix = RGBMatrix(options=options) canvas = matrix.CreateFrameCanvas()