From 68eae9cb47fd98a344a55cd35a3f5ba10a1f2af4 Mon Sep 17 00:00:00 2001 From: Michael Dietrich Date: Sat, 15 Jun 2024 11:35:31 +0200 Subject: [PATCH] add experimental support for c2 rgb --- .../chihiros_led_control/device/__init__.py | 2 ++ .../chihiros/chihiros_led_control/device/c2rgb.py | 15 +++++++++++++++ custom_components/chihiros/manifest.json | 6 +++++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 custom_components/chihiros/chihiros_led_control/device/c2rgb.py diff --git a/custom_components/chihiros/chihiros_led_control/device/__init__.py b/custom_components/chihiros/chihiros_led_control/device/__init__.py index 5829756..1083e45 100644 --- a/custom_components/chihiros/chihiros_led_control/device/__init__.py +++ b/custom_components/chihiros/chihiros_led_control/device/__init__.py @@ -10,6 +10,7 @@ from ..exception import DeviceNotFound from .a2 import AII from .base_device import BaseDevice +from .c2rgb import CIIRGB from .fallback import Fallback from .tiny_terrarium_egg import TinyTerrariumEgg from .wrgb2 import WRGBII @@ -44,6 +45,7 @@ async def get_device_from_address(device_address: str) -> BaseDevice: "AII", "WRGBII", "WRGBIIPro", + "CIIRGB", "FallBack", "BaseDevice", "RGBMode", diff --git a/custom_components/chihiros/chihiros_led_control/device/c2rgb.py b/custom_components/chihiros/chihiros_led_control/device/c2rgb.py new file mode 100644 index 0000000..4e9e808 --- /dev/null +++ b/custom_components/chihiros/chihiros_led_control/device/c2rgb.py @@ -0,0 +1,15 @@ +"""CII RGB device Model.""" + +from .base_device import BaseDevice + + +class CIIRGB(BaseDevice): + """Chihiros WRGB II device Class.""" + + _model_name = "CII RGB" + _model_code = ["DYNCRGP"] + _colors: dict[str, int] = { + "red": 0, + "green": 1, + "blue": 2, + } diff --git a/custom_components/chihiros/manifest.json b/custom_components/chihiros/manifest.json index b1cc07a..eef43ff 100644 --- a/custom_components/chihiros/manifest.json +++ b/custom_components/chihiros/manifest.json @@ -38,6 +38,10 @@ "local_name": "DYWPRO*", "connectable": true }, + { + "local_name": "DYNCRGP*", + "connectable": true + }, { "service_data_uuid": "6e400001-b5a3-f393-e0a9-e50e24dcca9e", "connectable": true @@ -54,5 +58,5 @@ "requirements": [ "typer[all]==0.9.0" ], - "version": "0.2.4" + "version": "0.3.0" }