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.

unhandled exception

See original GitHub issue

I’ve seen this in my log recently:

Logger: homeassistant.components.sensor
Source: custom_components/powercalc/strategy/linear.py:86
Integration: Sensor (documentation, issues)
First occurred: January 8, 2022, 04:59:21 (1 occurrences)
Last logged: January 8, 2022, 04:59:21

Error while setting up powercalc platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/powercalc/sensor.py", line 207, in async_setup_platform
    entities = await create_sensors(hass, config, discovery_info)
  File "/config/custom_components/powercalc/sensor.py", line 255, in create_sensors
    return await create_individual_sensors(
  File "/config/custom_components/powercalc/sensor.py", line 349, in create_individual_sensors
    power_sensor = await create_power_sensor(
  File "/config/custom_components/powercalc/sensors/power.py", line 116, in create_power_sensor
    calculation_strategy = calculation_strategy_factory.create(
  File "/config/custom_components/powercalc/strategy/factory.py", line 47, in create
    return self._create_linear(config, light_model, source_entity)
  File "/config/custom_components/powercalc/strategy/factory.py", line 69, in _create_linear
    return LinearStrategy(linear_config, self._hass, source_entity)
  File "/config/custom_components/powercalc/strategy/linear.py", line 47, in __init__
    self._calibration = self.create_calibrate_list()
  File "/config/custom_components/powercalc/strategy/linear.py", line 86, in create_calibrate_list
    list.append((min, float(self._config.get(CONF_MIN_POWER))))
TypeError: float() argument must be a string or a number, not 'NoneType'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
bramstrokercommented, Feb 6, 2022

Ah forgive me, pre-coffee me wasn’t understanding fully what you did there. 😃

LGTM

Haha, no worries 😉. It’s also rather complex topic. I am also no mathemetician, so programming this stuff and explaining is also no easy task for me. The linear strategy also has the calibration table (multiple calibration values) and other variables to account for, so it was a lot of work to get it right. But I’m pretty sure I have got it right now. Did a lot of testing with different scenarios.

0reactions
bramstrokercommented, Feb 11, 2022

I’m currently tapping in similar uncharted territory for me with writing some new stuff on adaptive_lighting, so I can see where you’re coming from 😅

That’s cool! good luck with that.

Closing this issue now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unhandled Exception Error: 5 Quick Fixes - Windows Report
What is an Unhandled exception? ... This error appears when the code of an application or program is not adequately equipped to handle...
Read more >
What is an Unhandled Exception, and How to Catch All C# ...
An exception is a known type of error. An unhandled exception occurs when the application code does not properly handle exceptions.
Read more >
How to Fix the Unhandled Exception Has Occurred Error on ...
Fix Unhandled Exception Has Occurred ; Step-1: Go to the Start menu and click on the Settings cog. (Shortcut keys: Win + I)...
Read more >
What is an Unhandled Exception? - Video & Lesson Transcript
An unhandled exception is an error in a computer program or application when the code has no appropriate handling exceptions.
Read more >
What is an unhandled exception mean? - Karma Computing
Generally an unhandled exception in your code means that your program is in a condition or state that you have not described to...
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