From eab97f93d26237416cf3593c2aefcf4cbade12b0 Mon Sep 17 00:00:00 2001 From: Michael Dietrich Date: Thu, 5 Sep 2024 19:59:20 +0200 Subject: [PATCH] add support for commander 1 controlled devices --- .../chihiros_led_control/device/__init__.py | 4 ++-- .../chihiros_led_control/device/backlight.py | 13 ------------- .../chihiros_led_control/device/commander1.py | 11 +++++++++++ custom_components/chihiros/manifest.json | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 custom_components/chihiros/chihiros_led_control/device/backlight.py create mode 100644 custom_components/chihiros/chihiros_led_control/device/commander1.py diff --git a/custom_components/chihiros/chihiros_led_control/device/__init__.py b/custom_components/chihiros/chihiros_led_control/device/__init__.py index e23d76a..2e6c866 100644 --- a/custom_components/chihiros/chihiros_led_control/device/__init__.py +++ b/custom_components/chihiros/chihiros_led_control/device/__init__.py @@ -9,10 +9,10 @@ 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 .commander1 import Commander1 from .fallback import Fallback from .tiny_terrarium_egg import TinyTerrariumEgg from .universal_wrgb import UniversalWRGB @@ -47,7 +47,7 @@ async def get_device_from_address(device_address: str) -> BaseDevice: __all__ = [ "TinyTerrariumEgg", "AII", - "Backlight", + "Commander1", "WRGBII", "WRGBIIPro", "WRGBIISlim", diff --git a/custom_components/chihiros/chihiros_led_control/device/backlight.py b/custom_components/chihiros/chihiros_led_control/device/backlight.py deleted file mode 100644 index 13b47ad..0000000 --- a/custom_components/chihiros/chihiros_led_control/device/backlight.py +++ /dev/null @@ -1,13 +0,0 @@ -"""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/commander1.py b/custom_components/chihiros/chihiros_led_control/device/commander1.py new file mode 100644 index 0000000..1e49291 --- /dev/null +++ b/custom_components/chihiros/chihiros_led_control/device/commander1.py @@ -0,0 +1,11 @@ +"""Commander 1 device Model.""" + +from .base_device import BaseDevice + + +class Commander1(BaseDevice): + """Chihiros Commander 1 device Class.""" + + _model_name = "Commander 1" + _model_codes = ["DYCOM"] + _colors: dict[str, int] = {"red": 0, "green": 1, "blue": 2, "white": 3} diff --git a/custom_components/chihiros/manifest.json b/custom_components/chihiros/manifest.json index 2e178e1..375473c 100644 --- a/custom_components/chihiros/manifest.json +++ b/custom_components/chihiros/manifest.json @@ -74,5 +74,5 @@ "requirements": [ "typer[all]==0.9.0" ], - "version": "0.6.2" + "version": "0.6.3" }