From 579617d2235b7cb24eb2de1947c4831b9e25ef4c Mon Sep 17 00:00:00 2001 From: Sven Sager Date: Fri, 8 Nov 2024 08:45:25 +0100 Subject: [PATCH] feat: Add more colors in constants for a RGB status LED On the Connect 4, the status LEDs are RGB. By switching several LEDs, further colors can be generated as red, green, blue. --- src/revpimodio2/_internal.py | 12 ++++++++++++ tests/test_import.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/revpimodio2/_internal.py b/src/revpimodio2/_internal.py index b1415ab..e28752f 100644 --- a/src/revpimodio2/_internal.py +++ b/src/revpimodio2/_internal.py @@ -8,7 +8,11 @@ __license__ = "LGPLv2" OFF = 0 GREEN = 1 RED = 2 +ORANGE = 3 BLUE = 4 +CYAN = 5 +MAGENTA = 6 +WHITE = 7 RISING = 31 FALLING = 32 BOTH = 33 @@ -54,8 +58,16 @@ def consttostr(value) -> str: return "GREEN" elif value == 2: return "RED" + elif value == 3: + return "ORANGE" elif value == 4: return "BLUE" + elif value == 5: + return "CYAN" + elif value == 6: + return "MAGENTA" + elif value == 7: + return "WHITE" elif value == 31: return "RISING" elif value == 32: diff --git a/tests/test_import.py b/tests/test_import.py index eb41847..f69c482 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -19,7 +19,7 @@ class ModuleImport(unittest.TestCase): self.assertEqual(revpimodio2._internal.consttostr(999), "") - lst_const = [0, 1, 2, 4, 31, 32, 33, 300, 301, 302, 4096] + lst_const = [0, 1, 2, 3, 4, 5, 6, 7, 31, 32, 33, 300, 301, 302, 4096] internal_dict = revpimodio2._internal.__dict__ # type: dict for key in internal_dict: if type(internal_dict[key]) is int: