8000 Hoover Air Purifier reporting non-integer literals causing sensor setup to crash · Issue #201 · gvigroux/hon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Hoover Air Purifier reporting non-integer literals causing sensor setup to crash #201

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

Open
Senexis opened this issue Mar 13, 2025 · 1 comment

Comments

@Senexis
Copy link
Senexis commented Mar 13, 2025

Hey folks!

This is just a quick bug report I've noticed while trying to setup this fine integration. Unfortunately I'm running into an error since the values reported by hOn seem to be floats instead of the integers the code currently expects.

Here's the full error I get when trying to enable to integration:

Error while setting up hon platform for sensor: invalid literal for int() with base 10: '58.0'

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/hon/sensor.py", line 85, in async_setup_entry
    if device.has("humidityIndoor") and device.getInt("humidityIndoor") > 0:
                                        ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hon/device.py", line 66, in getInt
    return int(self.get(item,0))
ValueError: invalid literal for int() with base 10: '58.0'

If you need any information from me, please feel free to ask. I am not entirely sure if you need more information than what the error provides, sorry about that!

@Senexis
Copy link
Author
Senexis commented Mar 13, 2025

Update: I've gone and changed the device.getInt occurances in the relevant sections to device.getFloat which seems to fix my issue. Obviously I would love to get it fixed in the repository too though. I am not sure if there's a specific reason it's getInt currently, but that could be a fix if there's no specific reason.

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
0