Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in helpers.py when logging error #57

Closed
laszlojakab opened this issue Jun 8, 2024 · 0 comments
Closed

Bug in helpers.py when logging error #57

laszlojakab opened this issue Jun 8, 2024 · 0 comments

Comments

@laszlojakab
Copy link

There is a bug in helpers.py, there is no reference to self (used in exception handling). See logs below:

2024-06-08 14:08:18.551 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/daily/helpers.py", line 28, in convert_to_float
    return float(float_value)
           ^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'unknown'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/daily/sensor.py", line 74, in <lambda>
    lambda event: self._handle_update(  # pylint: disable=unnecessary-lambda
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/daily/sensor.py", line 100, in _handle_update
    the_val = convert_to_float(input_state)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/daily/helpers.py", line 32, in convert_to_float
    float_value, self.coordinator.input_sensor
                 ^^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant