From ba24deecb7b270b9d62bb5a702dfbd3fc7953539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Wed, 17 Apr 2024 11:47:43 +0200 Subject: [PATCH] adds note that coloured enum values must be unique --- README.md | 3 +++ src/pydase/components/coloured_enum.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index c0e4b7f..1a982ad 100644 --- a/README.md +++ b/README.md @@ -638,6 +638,9 @@ my_service.status = MyStatus.FAILED ![ColouredEnum Component](docs/images/ColouredEnum_component.png) +**Note** that each enumeration name and value must be unique. +This means that you should use different colour formats when you want to use a colour multiple times. + #### Extending with New Components Users can also extend the library by creating custom components. This involves defining the behavior on the Python backend and the visual representation on the frontend. For those looking to introduce new components, the [guide on adding components](https://pydase.readthedocs.io/en/latest/dev-guide/Adding_Components/) provides detailed steps on achieving this. diff --git a/src/pydase/components/coloured_enum.py b/src/pydase/components/coloured_enum.py index 689a828..9c33539 100644 --- a/src/pydase/components/coloured_enum.py +++ b/src/pydase/components/coloured_enum.py @@ -56,4 +56,9 @@ class ColouredEnum(Enum): my_service = StatusExample() my_service.status = MyStatus.FAILED ``` + + Note + ---- + Each enumeration name and value must be unique. This means that you should use + different colour formats when you want to use a colour multiple times. """