question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error after 2.0.1b upgrade

See original GitHub issue

I am getting errors after the second restart of HA everything seemed ok after the upgrade the system booted with no errors but I noticed lights were not changing so I ended up rebooting again for a different reason and got these errors

Screenshot_20200906-204550.png

Log Details (ERROR)

Logger: homeassistant.setup
Source: custom_components/circadian_lighting/__init__.py:295
First occurred: 8:45:11 PM (1 occurrences)
Last logged: 8:45:11 PM

Error during setup of component circadian_lightingTraceback (most recent call last): 
File "/usr/src/homeassistant/homeassistant/setup.py", line 191, in _async_setup_component result = await task 
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) 
File "/config/custom_components/circadian_lighting/__init__.py", line 107, in setup hass.data[DOMAIN] = CircadianLighting( 
File "/config/custom_components/circadian_lighting/__init__.py", line 156, in __init__ self._percent = self.calc_percent() 
File "/config/custom_components/circadian_lighting/__init__.py", line 295, in calc_percent a = (y - k) / (h - x) ** 2 

UnboundLocalError: local variable 'k' referenced before assignment

Here is my config

circadian_lighting:
  min_colortemp: 2000
  max_colortemp: 6535
  sunrise_offset: +01:00:00
  sunset_offset: +01:00:00

And switch

# Circadian Lighting
  - platform: circadian_lighting
    name: Circadian House
    lights_ct:
      - light.mommy_s_light
      - light.daddy_s_light
      - light.kitchen_lights
      - light.dining_lights
      - light.entry_lights
      - light.bar_light
      - light.living_room
    lights_brightness:
      - light.kids_room_light
    min_brightness: 5
    max_brightness: 100

  - platform: circadian_lighting
    name: Circadian Bathrooms
    lights_ct:
      - light.master_bath_lights
      - light.downstairs_bath
      - light.hallway_lights
      - light.master_closet_2
    lights_brightness:
      - light.kids_bathroom_lights
      - light.laundry_light
    min_brightness: 30
    max_brightness: 100
      
  - platform: circadian_lighting
    name: Circadian Utilities
    lights_ct:
      - light.porch
      - light.back_porch
    disable_brightness_adjust: true

Screenshot_20200906-205405.png

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
claytonjncommented, Sep 11, 2020

I was waiting to close until I do a stable release, but I guess since the issue was introduced in beta and fixed in beta it makes more sense to close now 😃

1reaction
basnijholtcommented, Sep 9, 2020

I didn’t get notifications of these issues, but now I’ve turned it on. It is indeed that

today[SUN_EVENT_SUNRISE] < now_ts < today[SUN_EVENT_SUNSET] is False

and

today[SUN_EVENT_SUNSET] < now_ts < today[SUN_EVENT_SUNRISE] is False

I am looking into it now! And I agree that some more logging would be useful 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSCvk67783 - CNAE upgrade from 2.0.(1b) to 2.1 ... - Cisco Bug
Symptom: While upgrading CNAE from 2.0.(1b) to 2.1.1, customer uploads the upgrade ova file and starts the installation.
Read more >
vmkapi version removal and Installing/upgrading implication ...
This issue is caused when drivers are built with dependencies on older vmkapi versions (vmkapi_2_2_0_0 and vmkapi_2_3_0_0) and these vmkapi ...
Read more >
5220 Appliance SAN Client backup starts failing wi... - VOX
5220 Appliance SAN Client backup starts failing with error code 83 after firmware upgrade from 2.0.1 to 2.5.1b.
Read more >
Upgrade error codes - Windows Client - Microsoft Learn
In most cases, the cause is a driver compatibility issue. To troubleshoot a failed upgrade that has returned a result code of 0xC1900101, ......
Read more >
Release Notes: BIG-IP 16.1.0 New and Installation - AskF5
BIG-IP APM now supports Microsoft Identity Platform 2.0 endpoints. ... "After upgrade, the configuration fails to load with an error such as: 01070726:3: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found