claytonjn / hass-circadian_lighting

Circadian Lighting custom component for Home Assistant
Apache License 2.0
756 stars 89 forks source link

'Platform error: switch' after upgrading to Home Assistant 2022.9 #205

Closed mikke89 closed 1 year ago

mikke89 commented 1 year ago

First of all, thank you for making this great component. I've gotten so used to this behavior that it feels strange when the colors don't adjust automatically.

I'm getting the following error after upgrading to Home Assistant 2022.9.

Seems to be related to this change: https://developers.home-assistant.io/blog/2022/08/18/light_white_value_removed/

Logger: homeassistant.config
Source: custom_components/circadian_lighting/switch.py:12
Integration: Circadian Lighting ([documentation](https://github.com/claytonjn/hass-circadian_lighting), [issues](https://github.com/claytonjn/hass-circadian_lighting/issues))
First occurred: 14:43:22 (1 occurrences)
Last logged: 14:43:22

Platform error: switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 878, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 681, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 698, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/circadian_lighting/switch.py", line 12, in <module>
    from homeassistant.components.light import (
ImportError: cannot import name 'ATTR_WHITE_VALUE' from 'homeassistant.components.light' (/usr/src/homeassistant/homeassistant/components/light/__init__.py)
D-side commented 1 year ago

Best I can tell, already fixed in #199 and released in v2.1.2, what version of the integration are you using? An update to the fixed version or above should resolve this 🙂

mikke89 commented 1 year ago

Ah, you're right. I encountered #204 and rolled it back to 2.0.6. My mistake for not doing the research. I'll just hold on until #204 is fixed then, cheers.