Skip to content

Setup failed for custom integration 'powercalc': Unable to import component: cannot import name 'ATTR_COLOR_TEMP' from 'homeassistant.components.light #381

@PickleRick404

Description

@PickleRick404

I have this issue as of the last few weeks:

Logger: homeassistant.setup
Source: setup.py:343
First occurred: 17 March 2026 at 17:56:56 (1 occurrence)
Last logged: 17 March 2026 at 17:56:56

Setup failed for custom integration 'powercalc': Unable to import component: cannot import name 'ATTR_COLOR_TEMP' from 'homeassistant.components.light' (/usr/src/homeassistant/homeassistant/components/light/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1023, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._get_component, True
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 86, in run
    result = ctx.run(self.task)
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 73, in run
    return fn(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1083, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 201, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.14/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1398, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 759, in exec_module
  File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed
  File "/config/custom_components/powercalc/__init__.py", line 93, in <module>
    from .sensor import SENSOR_CONFIG
  File "/config/custom_components/powercalc/sensor.py", line 140, in <module>
    from .group_include.include import resolve_include_entities
  File "/config/custom_components/powercalc/group_include/include.py", line 16, in <module>
    from custom_components.powercalc.sensors.energy import RealEnergySensor
  File "/config/custom_components/powercalc/sensors/energy.py", line 48, in <module>
    from .power import PowerSensor, RealPowerSensor
  File "/config/custom_components/powercalc/sensors/power.py", line 95, in <module>
    from custom_components.powercalc.strategy.factory import PowerCalculatorStrategyFactory
  File "/config/custom_components/powercalc/strategy/factory.py", line 33, in <module>
    from .lut import LutRegistry, LutStrategy
  File "/config/custom_components/powercalc/strategy/lut.py", line 16, in <module>
    from homeassistant.components.light import (
    ...<6 lines>...
    )
ImportError: cannot import name 'ATTR_COLOR_TEMP' from 'homeassistant.components.light' (/usr/src/homeassistant/homeassistant/components/light/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 343, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1043, in async_get_component
    self._component_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1035, in async_get_component
    comp = self._get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1083, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 201, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.14/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1398, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 759, in exec_module
  File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed
  File "/config/custom_components/powercalc/__init__.py", line 93, in <module>
    from .sensor import SENSOR_CONFIG
  File "/config/custom_components/powercalc/sensor.py", line 140, in <module>
    from .group_include.include import resolve_include_entities
  File "/config/custom_components/powercalc/group_include/include.py", line 16, in <module>
    from custom_components.powercalc.sensors.energy import RealEnergySensor
  File "/config/custom_components/powercalc/sensors/energy.py", line 48, in <module>
    from .power import PowerSensor, RealPowerSensor
  File "/config/custom_components/powercalc/sensors/power.py", line 95, in <module>
    from custom_components.powercalc.strategy.factory import PowerCalculatorStrategyFactory
  File "/config/custom_components/powercalc/strategy/factory.py", line 33, in <module>
    from .lut import LutRegistry, LutStrategy
  File "/config/custom_components/powercalc/strategy/lut.py", line 16, in <module>
    from homeassistant.components.light import (
    ...<6 lines>...
    )
ImportError: cannot import name 'ATTR_COLOR_TEMP' from 'homeassistant.components.light' (/usr/src/homeassistant/homeassistant/components/light/__init__.py)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions