Skip to content

Integrations and platforms could not be set up #247

@fschaal

Description

@fschaal

Since a few weeks i get the startup message saying circadian lighting cannot setup.

image

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 404, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/circadian_lighting/__init__.py", line 119, in async_setup
    await hass.data[DOMAIN]._async_init(interval=conf.get(CONF_INTERVAL))
  File "/config/custom_components/circadian_lighting/__init__.py", line 157, in _async_init
    self._percent = await self.async_calc_percent()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/circadian_lighting/__init__.py", line 292, in async_calc_percent
    a = (y - k) / (h - x) ** 2
             ^
UnboundLocalError: cannot access local variable 'k' where it is not associated with a value

I have this in the configuration:

circadian_lighting:
  sunrise_offset: "-04:00:00"

And this switch:

- platform: circadian_lighting
  lights_ct:
    - light.office

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions