From 09edb7fc6090217d8e461fdce3f8460c03362ea3 Mon Sep 17 00:00:00 2001 From: Michael Dietrich Date: Sat, 31 Aug 2024 10:10:15 +0200 Subject: [PATCH] add support for c2 non rgb and white backlight --- .../chihiros_led_control/device/__init__.py | 4 ++++ .../chihiros_led_control/device/backlight.py | 13 +++++++++++++ .../chihiros/chihiros_led_control/device/c2.py | 13 +++++++++++++ .../chihiros/chihiros_led_control/device/c2rgb.py | 2 +- custom_components/chihiros/manifest.json | 10 +++++++++- 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 custom_components/chihiros/chihiros_led_control/device/backlight.py create mode 100644 custom_components/chihiros/chihiros_led_control/device/c2.py diff --git a/custom_components/chihiros/chihiros_led_control/device/__init__.py b/custom_components/chihiros/chihiros_led_control/device/__init__.py index 61acce5..1747df6 100644 --- a/custom_components/chihiros/chihiros_led_control/device/__init__.py +++ b/custom_components/chihiros/chihiros_led_control/device/__init__.py @@ -9,7 +9,9 @@ from ..exception import DeviceNotFound from .a2 import AII +from .backlight import Backlight from .base_device import BaseDevice +from .c2 import CII from .c2rgb import CIIRGB from .fallback import Fallback from .tiny_terrarium_egg import TinyTerrariumEgg @@ -44,8 +46,10 @@ async def get_device_from_address(device_address: str) -> BaseDevice: __all__ = [ "TinyTerrariumEgg", "AII", + "Backlight", "WRGBII", "WRGBIIPro", + "CII", "CIIRGB", "UniversalWRGB", "FallBack", diff --git a/custom_components/chihiros/chihiros_led_control/device/backlight.py b/custom_components/chihiros/chihiros_led_control/device/backlight.py new file mode 100644 index 0000000..13b47ad --- /dev/null +++ b/custom_components/chihiros/chihiros_led_control/device/backlight.py @@ -0,0 +1,13 @@ +"""Backlight device Model.""" + +from .base_device import BaseDevice + + +class Backlight(BaseDevice): + """Chihiros LED Backlight device Class.""" + + _model_name = "Backlight" + _model_codes = ["DYCOM"] + _colors: dict[str, int] = { + "white": 0, + } diff --git a/custom_components/chihiros/chihiros_led_control/device/c2.py b/custom_components/chihiros/chihiros_led_control/device/c2.py new file mode 100644 index 0000000..a29b7e5 --- /dev/null +++ b/custom_components/chihiros/chihiros_led_control/device/c2.py @@ -0,0 +1,13 @@ +"""CII device Model.""" + +from .base_device import BaseDevice + + +class CII(BaseDevice): + """Chihiros CII device Class.""" + + _model_name = "CII" + _model_code = ["DYNC2N"] + _colors: dict[str, int] = { + "white": 0, + } diff --git a/custom_components/chihiros/chihiros_led_control/device/c2rgb.py b/custom_components/chihiros/chihiros_led_control/device/c2rgb.py index 4e9e808..a03d18e 100644 --- a/custom_components/chihiros/chihiros_led_control/device/c2rgb.py +++ b/custom_components/chihiros/chihiros_led_control/device/c2rgb.py @@ -4,7 +4,7 @@ class CIIRGB(BaseDevice): - """Chihiros WRGB II device Class.""" + """Chihiros CII RGB device Class.""" _model_name = "CII RGB" _model_code = ["DYNCRGP"] diff --git a/custom_components/chihiros/manifest.json b/custom_components/chihiros/manifest.json index e4ab75a..5d77f68 100644 --- a/custom_components/chihiros/manifest.json +++ b/custom_components/chihiros/manifest.json @@ -46,6 +46,14 @@ "local_name": "DYU*", "connectable": true }, + { + "local_name": "DYNC2N*", + "connectable": true + }, + { + "local_name": "DYCOM*", + "connectable": true + }, { "service_data_uuid": "6e400001-b5a3-f393-e0a9-e50e24dcca9e", "connectable": true @@ -62,5 +70,5 @@ "requirements": [ "typer[all]==0.9.0" ], - "version": "0.4.1" + "version": "0.5.0" }