sbidy / wiz_light

A WiZ Light integration for Home Assistant
MIT License
341 stars 68 forks source link

Lights unavailable after updating to 0.4 #118

Closed excalbian closed 3 years ago

excalbian commented 3 years ago

Several of my lights are stuck in the "unavailable" state after restarting HA with the latest (0.4.0) release of this integration.

 ~ echo '{"method":"getSystemConfig","params":{}}' | nc -u -w 1 <bulb_ip address> 38899
{"method":"getSystemConfig","env":"pro","result":{"mac":"<valid MAC>","homeId":<censored>,"roomId":<private>,"moduleName":"ESP01_SHTW1C_31","fwVersion":"1.21.2","groupId":0,"drvConf":[20,1],"ewf":[255,0,87,255,0,0,36],"ewfHex":"ff0057ff000024","ping":0}}

Error adding entities for domain light with platform wiz_light Error while setting up wiz_light platform for light Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 315, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 421, in _async_add_entity capabilities=entity.capability_attributes, File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 462, in capability_attributes data[ATTR_EFFECT_LIST] = self.effect_list File "/config/custom_components/wiz_light/light.py", line 224, in effect_list return [ File "/config/custom_components/wiz_light/light.py", line 225, in self._scenes[key] IndexError: list index out of range



Please let me know if there is more I can do to help troubleshoot this issue. My python isn't great, but I've been programming for quite a while now.
sbidy commented 3 years ago

Ah yes - that is a bug. But this should be partly fixed with the version in the current master branch. So can you please download/clone the current version and test again?

The problem occurs only on TW (Tunable White) bulbs because they have different light modes.

excalbian commented 3 years ago

Thank you!! I updated to the current master using HACS and the bulbs that were giving me trouble all connected just fine 😄.

I didn't even realize that these bulbs were tunable white, but that makes sense why they were affected.