AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.67k stars 414 forks source link

Fix wrong lightMode for T5-2C-120 #1386

Closed tammeryousef1006 closed 5 months ago

tammeryousef1006 commented 5 months ago
2024-04-18 09:56:41.567 ERROR (MainThread) [custom_components.sonoff.core.entity] Can't init device: {'name': 'Bedroom', 'deviceid': '1001f8cf7f', 'apikey': '07a59ff0-9d6f-4963-97a1-5d9f2b1aeb5a', 'extra': {'uiid': 210, 'description': '', 'itCredential': 'hp62N4QaR45dmM1y', 'brandId': '5c4c1aee3a7d24c7100be054', 'apmac': 'd0:27:03:68:5e:d1', 'mac': 'd0:27:03:68:5e:d0', 'ui': '双通道触摸开关', 'modelInfo': '62e887c7963fb5bcc36ab154', 'model': 'SN-ESP32D0-T5-01', 'manufacturer': '深圳松诺技术有限公司', 'staMac': '80:64:6f:e0:68:5c'}, 'brandName': 'SONOFF', 'brandLogo': 'https://as-ota.coolkit.cc/logo/q62PevoglDNmwUJ9oPE7kRrpt1nL1CoA.png', 'showBrand': True, 'productModel': 'T5-2C-120', 'tags': {'m_eb5a_tamm': 'on', 'ck_channel_name': {'0': 'Bedroom Dim', '1': 'Bedroom Main'}, 'u_rgb_eb5a_.com': [{'mode': 1, 'rgb': [255, 0, 0], 'bright': 100, 'select': False}, {'mode': 1, 'rgb': [0, 255, 0], 'bright': 100, 'select': False}, {'mode': 1, 'rgb': [0, 0, 255], 'bright': 100, 'select': False}], 'm_1a21_tamm': 'on', 'channelSplit': {}}, 'devConfig': {}, 'settings': {'opsNotify': 0, 'opsHistory': 1, 'alarmNotify': 1, 'wxAlarmNotify': 0, 'wxOpsNotify': 0, 'wxDoorbellNotify': 0, 'appDoorbellNotify': 1}, 'devGroups': [], 'family': {'familyid': '5f02b73f2c8ea10007b558e9', 'index': 10, 'members': ['085cb063-0978-48c3-961a-fec632961a21', '2cd98a94-6b83-494e-9b3b-5bd4533c243d'], 'roomid': '5f02b73f2c8ea10007b558e7'}, 'shareTo': [], 'devicekey': '3284d406-8fcc-44f5-8760-93f357d8cea4', 'online': True, 'params': {'bindInfos': {'gaction': ['07a59ff0-9d6f-4963-97a1-5d9f2b1aeb5a_ewelinkGoogleHome'], 'alexa': ['07a59ff0-9d6f-4963-97a1-5d9f2b1aeb5a_26ca1996a20e8bd63617ab272d4eeede1d2d8e32'], 'smartThings': ['07a59ff0-9d6f-4963-97a1-5d9f2b1aeb5a_ewelink-smartthings-smart-home'], 'alice': ['07a59ff0-9d6f-4963-97a1-5d9f2b1aeb5a_eWeLinkAliceSmartHome'], 'ifttt': ['07a59ff0-9d6f-4963-97a1-5d9f2b1aeb5a_c7a1fe14a59d4ae58493540d644fbe6f']}, 'version': 8, 'reset_reason': 'ESP_RST_POWERON', 'fwVersion': '1.4.0', 'ssid': 'Tamer Umniah', 'bssid': '84:d8:1b:34:48:0e', 'switches': [{'switch': 'off', 'outlet': 0}, {'switch': 'off', 'outlet': 1}], 'lightSwitch': 'off', 'lightMode': 101, 'shock': 1, 'doNotDisturb': 1, 'doNotDisturbTime': {'from': '22:00', 'to': '07:00'}, 'onEffects': {'lightEffect': 1, 'soundEffect': 1, 'statusLight': 'on', 'statusLightTop': 1, 'statusLightBelow': 1, 'r': 0, 'g': 0, 'b': 255, 'br': 60, 'volume': 50}, 'offEffects': {'lightEffect': 2, 'soundEffect': 2, 'statusLight': 'off', 'statusLightTop': 1, 'statusLightBelow': 1, 'r': 0, 'g': 0, 'b': 255, 'br': 5, 'volume': 50}, 'configure': [{'startup': 'stay', 'enableDelay': 0, 'width': 19000, 'outlet': 0}, {'startup': 'stay', 'enableDelay': 0, 'width': 13000, 'outlet': 1}], 'pulses': [{'pulse': 'off', 'switch': 'off', 'outlet': 0, 'width': 500}, {'pulse': 'off', 'switch': 'off', 'outlet': 1, 'width': 500}], 'sledOnline': 'on', 'rssi': -59, 'staMac': '80:64:6f:e0:68:5c', 'timeZone': 3, 'only_device': {'ota': 'success', 'ota_fail_reason': 0}, 'addSubDevState': 'off', 'addTimeOut': 10, 'percentageControl': 0, 'calibState': False, 'slide': 1, 'preEffects': {'lightEffect': 1, 'soundEffect': 1, 'statusLight': 'on', 'statusLightTop': 1, 'statusLightBelow': 1, 'r': 0, 'g': 0, 'b': 255, 'br': 60, 'volume': 50}, 'subDevices': [], 'electromotor': 1, 'disableSwipeGesture': True, 'disableTapGesture': True}, 'isSupportGroup': True, 'isSupportedOnMP': False, 'isSupportChannelSplit': True, 'deviceFeature': {}}
Traceback (most recent call last):
File "/config/custom_components/sonoff/core/entity.py", line 87, in __init__
self.internal_update(None if self.event else params)
File "/config/custom_components/sonoff/core/entity.py", line 112, in internal_update
self.set_state(params)
File "/config/custom_components/sonoff/light.py", line 1160, in set_state
self._attr_effect = self._attr_effect_list[int(params["lightMode"])]
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
AlexxIT commented 5 months ago

https://github.com/AlexxIT/SonoffLAN/releases/tag/v3.7.1