Thank you for the beta fix. I installed it yesterday and it seems to have fixed the issue with the lights becoming unavailable frequently - however I believe it introduced a couple of new issues.
A little background: I have several bulbs connected to either dumb switches, or smart switches that just power cycle. In either case, I have half a dozen bulbs that are not always powered on. Not ideal, but was never much of an issue before - they would become controllable a minute or so after powering on.
You'll notice the Integration says LIFX 6 times - one for each bulb it's linked to. And here is the device info.
That's probably minor, and I can clean it up manually if needed, but it's something to be aware of.
The switches controlling the Front Porch and Balcony lights are off - the bulbs have no power. However they still show online, you can attempt to set colors, brightness, etc. Of course doing so is unsuccessful, and results in loads of errors in the log
2022-12-20 10:18:22.202 ERROR (MainThread) [homeassistant.components.light] Error adding entities for domain light with platform lifx
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 986, in state_attributes
color_mode = self._light_internal_color_mode
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 812, in _light_internal_color_mode
if (color_mode := self.color_mode) is None:
File "/config/custom_components/lifx/light.py", line 357, in color_mode
has_sat = self.bulb.color[HSBK_SATURATION]
TypeError: 'NoneType' object is not subscriptable
2022-12-20 10:18:22.215 ERROR (MainThread) [homeassistant.components.light] Error while setting up lifx platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 986, in state_attributes
color_mode = self._light_internal_color_mode
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 812, in _light_internal_color_mode
if (color_mode := self.color_mode) is None:
File "/config/custom_components/lifx/light.py", line 357, in color_mode
has_sat = self.bulb.color[HSBK_SATURATION]
TypeError: 'NoneType' object is not subscriptable
2022-12-20 10:18:44.468 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 316, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 121, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 381, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 986, in state_attributes
color_mode = self._light_internal_color_mode
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 812, in _light_internal_color_mode
if (color_mode := self.color_mode) is None:
File "/config/custom_components/lifx/light.py", line 357, in color_mode
has_sat = self.bulb.color[HSBK_SATURATION]
TypeError: 'NoneType' object is not subscriptable
2022-12-20 10:19:06.467 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 316, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 121, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 381, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 986, in state_attributes
color_mode = self._light_internal_color_mode
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 812, in _light_internal_color_mode
if (color_mode := self.color_mode) is None:
File "/config/custom_components/lifx/light.py", line 357, in color_mode
has_sat = self.bulb.color[HSBK_SATURATION]
Similarly, it seems that some lights simply never showed online, even after power was restored. In both cases reloading the integration for those bulbs updated it to the correct state, however it does not update properly again with the next power cycle - so you're back at square one.
If you want me to open separate issues for these please let me know. I figured the root cause of both was likely the powering of the bulbs. Please let me know if you need any more info