|
32 | 32 | DEW_POINT, |
33 | 33 | DIM_OUT_1, |
34 | 34 | DIM_OUT_2, |
| 35 | + DIMMER_RGBW, |
35 | 36 | DIN, |
36 | 37 | DMD3_1, |
37 | 38 | FA3_612M, |
|
40 | 41 | GCR3_11, |
41 | 42 | GDB3_10, |
42 | 43 | GRT3_50, |
| 44 | + GRT3_70, |
43 | 45 | GSB3_20SX, |
44 | 46 | GSB3_40_V2, |
45 | 47 | GSB3_40SX, |
|
66 | 68 | LIGHT, |
67 | 69 | LIGHT_IN, |
68 | 70 | MAX_TEMP, |
| 71 | + MCD3_01, |
69 | 72 | MSB3_40, |
70 | 73 | MSB3_60, |
71 | 74 | MSB3_90, |
72 | 75 | NUMBER, |
73 | 76 | OUT, |
74 | 77 | PLUS_MINUS_BUTTONS, |
| 78 | + PMS3_01, |
75 | 79 | PUBLIC_HOLIDAY, |
76 | 80 | RC3_610DALI, |
77 | 81 | RELAY, |
|
118 | 122 | LightCoaToa, |
119 | 123 | Number, |
120 | 124 | Relay, |
| 125 | + RGBWLight, |
121 | 126 | Shutter, |
122 | 127 | SimpleLight, |
123 | 128 | SimpleRelay, |
@@ -1703,6 +1708,75 @@ def create_inels_set_value(cls, device_value: DeviceValue) -> str: |
1703 | 1708 | return cls.create_command_payload(cmd) |
1704 | 1709 |
|
1705 | 1710 |
|
| 1711 | +class DT_153(Base): |
| 1712 | + INELS_TYPE = DIMMER_RGBW |
| 1713 | + HA_TYPE = LIGHT |
| 1714 | + TYPE_ID = "153" |
| 1715 | + |
| 1716 | + DATA = { |
| 1717 | + "LED_1": [4, 5, 6, 7, 12], |
| 1718 | + "LED_2": [13, 14, 15, 20, 21], |
| 1719 | + "LED_3": [22, 23, 28, 29, 30], |
| 1720 | + TEMP_IN: [8, 9], |
| 1721 | + } |
| 1722 | + |
| 1723 | + @classmethod |
| 1724 | + def create_ha_value_object(cls, device_value: DeviceValue) -> str: |
| 1725 | + """Create a HA value object for a RGBW.""" |
| 1726 | + led_1 = trim_inels_status_bytes(device_value.inels_status_value, cls.DATA, "LED_1") |
| 1727 | + led_2 = trim_inels_status_bytes(device_value.inels_status_value, cls.DATA, "LED_2") |
| 1728 | + led_3 = trim_inels_status_bytes(device_value.inels_status_value, cls.DATA, "LED_3") |
| 1729 | + |
| 1730 | + temp_in = trim_inels_status_values(device_value.inels_status_value, cls.DATA, TEMP_IN, "") |
| 1731 | + |
| 1732 | + rgbw = [] |
| 1733 | + for led in [led_1, led_2, led_3]: |
| 1734 | + r, g, b, w, y = [int(i, 16) for i in led] |
| 1735 | + rgbw.append(RGBWLight(r=r, g=g, b=b, w=w, brightness=y)) |
| 1736 | + |
| 1737 | + return new_object(rgbw=rgbw, temp_in=temp_in) |
| 1738 | + |
| 1739 | + @classmethod |
| 1740 | + def create_inels_set_value(cls, device_value: DeviceValue) -> str: |
| 1741 | + """Generate command string to set the RGBW and brightness values.""" |
| 1742 | + led_1, led_2, led_3 = device_value.ha_value.rgbw |
| 1743 | + command = [ |
| 1744 | + 0, |
| 1745 | + 0, |
| 1746 | + 0, |
| 1747 | + 0, |
| 1748 | + led_1.r, |
| 1749 | + led_1.g, |
| 1750 | + led_1.b, |
| 1751 | + led_1.w, |
| 1752 | + 0, |
| 1753 | + 0, |
| 1754 | + 0, |
| 1755 | + 0, |
| 1756 | + led_1.brightness, |
| 1757 | + led_2.r, |
| 1758 | + led_2.g, |
| 1759 | + led_2.b, |
| 1760 | + 0, |
| 1761 | + 0, |
| 1762 | + 0, |
| 1763 | + 0, |
| 1764 | + led_2.w, |
| 1765 | + led_2.brightness, |
| 1766 | + led_3.r, |
| 1767 | + led_3.g, |
| 1768 | + 0, |
| 1769 | + 0, |
| 1770 | + 0, |
| 1771 | + 0, |
| 1772 | + led_3.b, |
| 1773 | + led_3.w, |
| 1774 | + led_3.brightness, |
| 1775 | + 0, |
| 1776 | + ] |
| 1777 | + return Formatter.format_data(command) |
| 1778 | + |
| 1779 | + |
1706 | 1780 | class DT_156(Base): |
1707 | 1781 | INELS_TYPE = ADC3_60M |
1708 | 1782 | HA_TYPE = SENSOR |
@@ -1812,6 +1886,8 @@ class Command(IntEnum): |
1812 | 1886 | SHUTTER_STATE_SET = { |
1813 | 1887 | Shutter_state.Open: [Command.OPEN, Command.CLOSE], |
1814 | 1888 | Shutter_state.Closed: [Command.CLOSE, Command.OPEN], |
| 1889 | + Shutter_state.Stop_up: [Command.CLOSE, Command.CLOSE], |
| 1890 | + Shutter_state.Stop_down: [Command.CLOSE, Command.CLOSE], |
1815 | 1891 | } |
1816 | 1892 |
|
1817 | 1893 | @staticmethod |
@@ -2305,6 +2381,29 @@ def create_ha_value_object(cls, device_value: DeviceValue) -> Any: |
2305 | 2381 | ) |
2306 | 2382 |
|
2307 | 2383 |
|
| 2384 | +class DT_171(Base): |
| 2385 | + INELS_TYPE = MCD3_01 |
| 2386 | + HA_TYPE = SENSOR |
| 2387 | + TYPE_ID = "171" |
| 2388 | + |
| 2389 | + DATA = {STATE: [0]} |
| 2390 | + |
| 2391 | + @classmethod |
| 2392 | + def create_ha_value_object(cls, device_value: DeviceValue) -> Any: |
| 2393 | + state = trim_inels_status_values(device_value.inels_status_value, cls.DATA, STATE, "") |
| 2394 | + motion = int(state, 16) == 1 |
| 2395 | + |
| 2396 | + return new_object( |
| 2397 | + motion=motion, |
| 2398 | + ) |
| 2399 | + |
| 2400 | + |
| 2401 | +class DT_172(DT_171): |
| 2402 | + INELS_TYPE = PMS3_01 |
| 2403 | + HA_TYPE = SENSOR |
| 2404 | + TYPE_ID = "172" |
| 2405 | + |
| 2406 | + |
2308 | 2407 | class DT_174(DT_143): |
2309 | 2408 | INELS_TYPE = GSB3_40SX_V2 |
2310 | 2409 | HA_TYPE = SENSOR |
@@ -2351,6 +2450,61 @@ class DT_179(DT_143): |
2351 | 2450 | INTERFACE_BUTTON_COUNT = 9 |
2352 | 2451 |
|
2353 | 2452 |
|
| 2453 | +class DT_180(Base): |
| 2454 | + INELS_TYPE = GRT3_70 |
| 2455 | + HA_TYPE = SENSOR |
| 2456 | + TYPE_ID = "180" |
| 2457 | + |
| 2458 | + DATA = { |
| 2459 | + SW: [1], |
| 2460 | + TEMP_IN: [2, 3], |
| 2461 | + DIN: [7], |
| 2462 | + LIGHT_IN: [8, 9, 10, 11], |
| 2463 | + AIN: [12, 13], |
| 2464 | + HUMIDITY: [14, 15], |
| 2465 | + DEW_POINT: [16, 17], |
| 2466 | + } |
| 2467 | + |
| 2468 | + @classmethod |
| 2469 | + def create_ha_value_object(cls, device_value: DeviceValue) -> Any: |
| 2470 | + switches = trim_inels_status_values(device_value.inels_status_value, cls.DATA, SW, "") |
| 2471 | + switches_hex_str = f"0x{switches}" |
| 2472 | + switches_bin_str = f"{int(switches_hex_str, 16):0>8b}" |
| 2473 | + |
| 2474 | + temp_in = trim_inels_status_values(device_value.inels_status_value, cls.DATA, TEMP_IN, "") |
| 2475 | + |
| 2476 | + digital_inputs = trim_inels_status_values(device_value.inels_status_value, cls.DATA, DIN, "") |
| 2477 | + digital_inputs = f"0x{digital_inputs}" |
| 2478 | + digital_inputs = f"{int(digital_inputs, 16):0>8b}" |
| 2479 | + din = [digital_inputs[7] == "1"] |
| 2480 | + prox = digital_inputs[6] == "1" |
| 2481 | + |
| 2482 | + light_in = trim_inels_status_values(device_value.inels_status_value, cls.DATA, LIGHT_IN, "") |
| 2483 | + ain = trim_inels_status_values(device_value.inels_status_value, cls.DATA, AIN, "") |
| 2484 | + humidity = trim_inels_status_values(device_value.inels_status_value, cls.DATA, HUMIDITY, "") |
| 2485 | + dewpoint = trim_inels_status_values(device_value.inels_status_value, cls.DATA, DEW_POINT, "") |
| 2486 | + |
| 2487 | + return new_object( |
| 2488 | + din=din, |
| 2489 | + prox=prox, |
| 2490 | + interface=[ |
| 2491 | + switches_bin_str[7] == "1", |
| 2492 | + switches_bin_str[6] == "1", |
| 2493 | + switches_bin_str[5] == "1", |
| 2494 | + switches_bin_str[4] == "1", |
| 2495 | + switches_bin_str[3] == "1", |
| 2496 | + switches_bin_str[2] == "1", |
| 2497 | + switches_bin_str[1] == "1", |
| 2498 | + ], |
| 2499 | + temp_in=temp_in, |
| 2500 | + light_in=light_in, |
| 2501 | + ain=ain, |
| 2502 | + humidity=humidity, |
| 2503 | + dewpoint=dewpoint, |
| 2504 | + backlit=False, |
| 2505 | + ) |
| 2506 | + |
| 2507 | + |
2354 | 2508 | class DT_BITS: |
2355 | 2509 | INELS_TYPE = BITS |
2356 | 2510 | HA_TYPE = SWITCH |
|
0 commit comments